Skip to content

Commit

Permalink
👷 (repo): Fix auto update tools workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman committed Oct 31, 2024
1 parent a18571a commit 23aa631
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/update_toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,26 @@ jobs:
- name: Set new versions
if: steps.changes.outputs.status > 0
id: new-versions
run: |
proto use
pnpm i
echo "version=$(pnpm -v)" >> $GITHUB_OUTPUT
- name: Update package.json
if: steps.changes.outputs.status > 0
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const packageJson = fs.readFileSync('./package.json', 'utf8');
const json = JSON.parse(packageJson);
const packageManager = json.packageManager;
const newVersion = `pnpm@${{ steps.new-versions.outputs.version }}`;
if (packageManager !== newVersion) {
json.packageManager = newVersion;
fs.writeFileSync('./package.json', JSON.stringify(json, null, 2));
}
- name: Health check
if: steps.changes.outputs.status > 0
Expand All @@ -51,6 +68,7 @@ jobs:
if: steps.changes.outputs.status > 0 && success()
run: |
git add .prototools
git add package.json
git commit -m "🔧 (repo) [NO-ISSUE]: Update toolchain"
git push origin ${{ env.BRANCH_NAME }}
gh pr create \
Expand Down

0 comments on commit 23aa631

Please sign in to comment.