fix: grant workflows permission for rolling tag updates. #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update rolling release lines | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Released semver (X.Y.Z) to refresh rolling line aliases for | ||
| required: true | ||
| permissions: | ||
| contents: write | ||
| workflows: write | ||
| jobs: | ||
| update: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout main | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Resolve release commit | ||
| id: rel | ||
| run: echo "sha=$(git rev-list -n 1 refs/tags/v${{ inputs.version }})" >> "$GITHUB_OUTPUT" | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "24" | ||
| - name: Download release bundle | ||
| run: gh release download "v${{ inputs.version }}" -p ui-bundle.zip | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Update rolling release lines | ||
| run: node .github/scripts/post-release.mjs "${{ inputs.version }}" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| VERSION: v${{ inputs.version }} | ||
| RELEASE_SHA: ${{ steps.rel.outputs.sha }} | ||
| GITHUB_REPOSITORY: ${{ github.repository }} | ||
| - name: Commit supported-lines.json on main | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| cp supported-lines.json /tmp/supported-lines.json | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git fetch origin main | ||
| git checkout main | ||
| git pull origin main | ||
| cp /tmp/supported-lines.json supported-lines.json | ||
| git add supported-lines.json | ||
| if git diff --staged --quiet; then | ||
| echo "supported-lines.json unchanged" | ||
| else | ||
| git commit -m "chore: update supported-lines.json for v${{ inputs.version }}" | ||
| git push origin main | ||
| fi | ||