|
| 1 | +name: Compile gh-aw lock file |
| 2 | + |
| 3 | +# One-shot workflow: installs gh-aw, compiles fix-renovate-tests.md, |
| 4 | +# and commits the resulting lock file back to the branch. |
| 5 | +# Run manually after changing fix-renovate-tests.md frontmatter. |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + branch: |
| 11 | + description: "Branch containing fix-renovate-tests.md to compile" |
| 12 | + required: true |
| 13 | + default: "task/fixes" |
| 14 | + |
| 15 | +jobs: |
| 16 | + compile: |
| 17 | + name: Compile and commit lock file |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Obtain a Notify PR Bot GitHub App Installation Access Token |
| 22 | + run: | |
| 23 | + TOKEN="$(npx --yes obtain-github-app-installation-access-token@1.1.0 ci ${{ secrets.PR_BOT_GITHUB_TOKEN }})" |
| 24 | + echo "::add-mask::$TOKEN" |
| 25 | + echo "BOT_TOKEN=$TOKEN" >> $GITHUB_ENV |
| 26 | +
|
| 27 | + - name: Checkout branch |
| 28 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 29 | + with: |
| 30 | + token: ${{ env.BOT_TOKEN }} |
| 31 | + ref: ${{ github.event.inputs.branch }} |
| 32 | + fetch-depth: 1 |
| 33 | + |
| 34 | + - name: Install gh-aw extension |
| 35 | + env: |
| 36 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + run: gh extension install github/gh-aw |
| 38 | + |
| 39 | + - name: Compile fix-renovate-tests.md |
| 40 | + env: |
| 41 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + run: gh aw compile .github/workflows/fix-renovate-tests.md |
| 43 | + |
| 44 | + - name: Commit and push lock file |
| 45 | + run: | |
| 46 | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 47 | + git config user.name "github-actions[bot]" |
| 48 | + git add .github/workflows/fix-renovate-tests.lock.yml |
| 49 | + if git diff --cached --quiet; then |
| 50 | + echo "Lock file unchanged — nothing to commit." |
| 51 | + else |
| 52 | + git commit -m "chore: recompile gh-aw lock file [skip changelog]" |
| 53 | + git push |
| 54 | + fi |
0 commit comments