Skip to content

Commit 1b82eb2

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

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/check-dist.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ jobs:
4141
- name: Build dist/ Directory
4242
run: npm run bundle
4343

44-
# This will fail the workflow if the PR wasn't created by Dependabot.
44+
# This will fail the workflow if the `dist/` directory is different than
45+
# expected.
4546
- name: Compare Directories
4647
id: diff
4748
run: |
@@ -51,9 +52,20 @@ jobs:
5152
exit 1
5253
fi
5354
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' }}
55+
# If `dist` was different and this is a renovate commit, push the changes.
56+
- if: ${{ failure() && steps.diff.outcome == 'failure' && github.actor == 'renovate[bot]' }}
57+
name: Commit /dist Directory
58+
uses: EndBug/add-and-commit@v9
59+
with:
60+
add: dist
61+
default_author: github_actions
62+
fetch: false
63+
message: "Rebuild Action"
64+
pathspec_error_handling: exitImmediately
65+
66+
# If `dist/` was different than expected, upload the expected version as a
67+
# workflow artifact.
68+
- if: ${{ failure() && steps.diff.outcome == 'failure' && github.actor != 'renovate[bot]' }}
5769
name: Upload Artifact
5870
uses: actions/upload-artifact@v4
5971
with:

0 commit comments

Comments
 (0)