diff --git a/.github/workflows/check-provider-major.yml b/.github/workflows/check-provider-major.yml index 5f0227b..9557ead 100644 --- a/.github/workflows/check-provider-major.yml +++ b/.github/workflows/check-provider-major.yml @@ -25,20 +25,22 @@ jobs: run: yarn install --immutable --network-timeout 300000 - name: Check Baileys - run: yarn node ./scripts/checker.js --name=baileys --stable=false + run: yarn node ./scripts/checker.js --name=baileys --stable=true - name: Check Venom - run: yarn node ./scripts/checker.js --name=venom --stable=false + run: yarn node ./scripts/checker.js --name=venom --stable=true - name: Check web-whatsapp - run: yarn node ./scripts/checker.js --name=web-whatsapp --stable=false + run: yarn node ./scripts/checker.js --name=web-whatsapp --stable=true - name: Check Meta - run: yarn node ./scripts/checker.js --name=meta --stable=false + run: yarn node ./scripts/checker.js --name=meta --stable=true - name: Check Twilio - run: yarn node ./scripts/checker.js --name=twilio --stable=false + run: yarn node ./scripts/checker.js --name=twilio --stable=true - uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: 'ci(providers): 🚩 Check BREAKING CHANGE' + create_branch: true + branch: feature/breaking-change diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index a7d4e46..9f9e814 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -6,7 +6,6 @@ on: pull_request: branches: - dev - - main types: [closed] jobs: diff --git a/scripts/checker.js b/scripts/checker.js index 67952c8..b68cd57 100644 --- a/scripts/checker.js +++ b/scripts/checker.js @@ -47,9 +47,15 @@ const checkPkgStable = async (pkgName = '', version = '') => { } ) - const listVersions = JSON.parse(stdout).reverse() - console.log(`[${pkgName}]: `, listVersions) - return listVersions.at(0) + try { + const listVersions = JSON.parse(stdout).reverse() + console.log(`[${pkgName}]: `, listVersions) + return listVersions.at(0) + } catch (e) { + const listVersions = [stdout.trim().replace('\n').replaceAll('"', '')] + console.log(`[${pkgName}]: `, listVersions) + return listVersions.at(0) + } } /**