Skip to content

Commit 627859d

Browse files
committed
ci: Add automated rebuild for renovate
1 parent c54e63b commit 627859d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/check-dist.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.pull_request.head.ref }}
3133

3234
- name: Setup Node.js
3335
uses: actions/setup-node@v4
@@ -41,7 +43,8 @@ jobs:
4143
- name: Build dist/ Directory
4244
run: npm run bundle
4345

44-
# This will fail the workflow if the PR wasn't created by Dependabot.
46+
# This will fail the workflow if the `dist/` directory is different than
47+
# expected.
4548
- name: Compare Directories
4649
id: diff
4750
run: |
@@ -51,9 +54,20 @@ jobs:
5154
exit 1
5255
fi
5356
54-
# If `dist/` was different than expected, and this was not a Dependabot
55-
# PR, upload the expected version as a workflow artifact.
56-
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
57+
# If `dist` was different and this is a renovate commit, push the changes.
58+
- if: ${{ failure() && steps.diff.outcome == 'failure' && github.actor == 'renovate[bot]' }}
59+
name: Commit /dist Directory
60+
uses: EndBug/add-and-commit@v9
61+
with:
62+
add: dist
63+
default_author: github_actions
64+
fetch: false
65+
message: "Rebuild Action"
66+
pathspec_error_handling: exitImmediately
67+
68+
# If `dist/` was different than expected, upload the expected version as a
69+
# workflow artifact.
70+
- if: ${{ failure() && steps.diff.outcome == 'failure' && github.actor != 'renovate[bot]' }}
5771
name: Upload Artifact
5872
uses: actions/upload-artifact@v4
5973
with:

0 commit comments

Comments
 (0)