File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Rebuild distributables for Dependabot PRs
2+
3+ on :
4+ push :
5+ branches :
6+ - ' dependabot/npm**'
7+
8+ permissions :
9+ contents : write
10+
11+ # This allows a subsequently queued workflow run to interrupt previous runs
12+ concurrency :
13+ group : ' ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
14+ cancel-in-progress : true
15+
16+ jobs :
17+ rebuild-dist :
18+ if : ${{ github.event.sender.login == 'dependabot[bot]' }}
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v3
23+
24+ - name : Setup Node.JS
25+ uses : actions/setup-node@v3
26+ with :
27+ node-version : 16.x
28+ cache : ' npm'
29+
30+ - name : Install dependencies
31+ run : npm ci
32+
33+ - name : Rebuild the dist/ directory
34+ run : npm run prepare
35+
36+ - name : Commit any differences present in the dist/ directory
37+ run : |
38+ if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
39+ echo "Detected uncommitted changes after rebuild in dist folder. Committing..."
40+ git add dist/
41+ git config --local user.name "github-actions[bot]"
42+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
43+ git commit -m "Update distributables after Dependabot 🤖"
44+ echo "Pushing branch ${{ github.ref_name }}"
45+ git push origin ${{ github.ref_name }}
46+ fi
You can’t perform that action at this time.
0 commit comments