File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 28
28
steps :
29
29
- name : Checkout
30
30
uses : actions/checkout@v4
31
+ with :
32
+ ref : ${{ github.event.pull_request.head.ref }}
31
33
32
34
- name : Setup Node.js
33
35
uses : actions/setup-node@v4
41
43
- name : Build dist/ Directory
42
44
run : npm run bundle
43
45
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.
45
48
- name : Compare Directories
46
49
id : diff
47
50
run : |
51
54
exit 1
52
55
fi
53
56
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]' }}
57
71
name : Upload Artifact
58
72
uses : actions/upload-artifact@v4
59
73
with :
You can’t perform that action at this time.
0 commit comments