-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.22 KB
/
dependabot-dist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Dependabot post-update
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches: main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
post-update:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout out pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- run: npm install --frozen-lockfile
- run: npm run prepare
- name: Commit and push if needed
run: |
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "💾 no changes to dist/index.js"
exit 0
fi
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Apply dist/index.js changes"
git push
echo "💾 pushed dist/index.js changes"