Visitar URL original
ci: fix job · goreleaser/goreleaser-action@d393459 · GitHub
Skip to content

Commit d393459

Browse files
committed
ci: fix job
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
1 parent ee731b1 commit d393459

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

‎.github/workflows/rebuild-dist.yml‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ on:
1313
workflow_dispatch:
1414

1515
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.
1919
#
2020
# Dependabot runs get a read-only GITHUB_TOKEN, and commits pushed with it do
2121
# not re-trigger checks. Pushing the dist commit therefore uses a GitHub App
2222
# token, which is repo-scoped and short-lived, and can re-run workflows.
2323
# 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.
2728
rebuild-dist:
28-
if: github.actor == 'dependabot[bot]'
29+
if: github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch'
2930
runs-on: ubuntu-latest
3031
steps:
3132
- name: Check app credentials
@@ -51,7 +52,7 @@ jobs:
5152
if: steps.app.outputs.available == 'true'
5253
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
5354
with:
54-
ref: ${{ github.head_ref }}
55+
ref: ${{ github.head_ref || github.ref_name }}
5556
token: ${{ steps.token.outputs.token }}
5657
- name: Setup Node.js
5758
if: steps.app.outputs.available == 'true'
@@ -68,7 +69,7 @@ jobs:
6869
- name: Commit and push dist if changed
6970
if: steps.app.outputs.available == 'true'
7071
env:
71-
HEAD_REF: ${{ github.head_ref }}
72+
HEAD_REF: ${{ github.head_ref || github.ref_name }}
7273
run: |
7374
if [ -z "$(git status --porcelain -- dist)" ]; then
7475
echo "dist is already up to date."

0 commit comments

Comments
 (0)