|
13 | 13 | workflow_dispatch: |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - # Rebuilds the bundled dist/ on Dependabot PRs and pushes it back to the PR |
17 | | - # branch, so a dependency bump and its matching dist/ land in a single PR and |
18 | | - # the validate workflow stays green. |
| 16 | + # Rebuilds the bundled dist/ on Dependabot PRs (and on manual workflow_dispatch |
| 17 | + # runs) and pushes it back to the branch, so a dependency bump and its matching |
| 18 | + # dist/ land together and the validate workflow stays green. |
19 | 19 | # |
20 | 20 | # Dependabot runs get a read-only GITHUB_TOKEN, and commits pushed with it do |
21 | 21 | # not re-trigger checks. Pushing the dist commit therefore uses a GitHub App |
22 | 22 | # token, which is repo-scoped and short-lived, and can re-run workflows. |
23 | 23 | # Configure a GitHub App with contents:write on this repo and set its |
24 | | - # credentials as Dependabot secrets named GORELEASER_APP_ID and |
25 | | - # GORELEASER_APP_KEY (Dependabot runs only expose Dependabot secrets). |
26 | | - # Until both exist this job is a no-op. |
| 24 | + # credentials as GORELEASER_APP_ID and GORELEASER_APP_KEY. Dependabot runs only |
| 25 | + # expose Dependabot secrets, while workflow_dispatch runs only expose Actions |
| 26 | + # secrets, so set both copies to cover both triggers. Until both exist this job |
| 27 | + # is a no-op. |
27 | 28 | rebuild-dist: |
28 | | - if: github.actor == 'dependabot[bot]' |
| 29 | + if: github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' |
29 | 30 | runs-on: ubuntu-latest |
30 | 31 | steps: |
31 | 32 | - name: Check app credentials |
|
51 | 52 | if: steps.app.outputs.available == 'true' |
52 | 53 | uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
53 | 54 | with: |
54 | | - ref: ${{ github.head_ref }} |
| 55 | + ref: ${{ github.head_ref || github.ref_name }} |
55 | 56 | token: ${{ steps.token.outputs.token }} |
56 | 57 | - name: Setup Node.js |
57 | 58 | if: steps.app.outputs.available == 'true' |
|
68 | 69 | - name: Commit and push dist if changed |
69 | 70 | if: steps.app.outputs.available == 'true' |
70 | 71 | env: |
71 | | - HEAD_REF: ${{ github.head_ref }} |
| 72 | + HEAD_REF: ${{ github.head_ref || github.ref_name }} |
72 | 73 | run: | |
73 | 74 | if [ -z "$(git status --porcelain -- dist)" ]; then |
74 | 75 | echo "dist is already up to date." |
|
0 commit comments