43
43
.
44
44
!node_modules
45
45
retention-days : 1
46
-
46
+
47
+ dependabot :
48
+ name : ' Dependabot'
49
+ needs : build # After the E2E and build jobs, if one of them fails, it won't merge the PR.
50
+ runs-on : ubuntu-latest
51
+ if : ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} # Detect that the PR author is dependabot
52
+ steps :
53
+ - name : Enable auto-merge for Dependabot PRs
54
+ run : gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR
55
+ env :
56
+ PR_URL : ${{github.event.pull_request.html_url}}
57
+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
58
+
47
59
npm-publish-build :
48
60
needs : build
49
61
runs-on : ubuntu-latest
@@ -59,14 +71,14 @@ jobs:
59
71
run : ' sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
60
72
- name : Disable pre- and post-publish actions
61
73
run : ' sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
62
- - uses : JS-DevTools/npm-publish@v3 .1.1
74
+ - uses : JS-DevTools/npm-publish@v4 .1.0
63
75
if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
64
76
with :
65
77
token : ${{ secrets.NPM_TOKEN }}
66
78
tag : ${{ env.GITHUB_REF_SLUG }}
67
79
68
80
npm-publish-latest :
69
- needs : build
81
+ needs : [ build, npm-publish-build]
70
82
runs-on : ubuntu-latest
71
83
if : github.ref == 'refs/heads/main'
72
84
steps :
78
90
node-version : 20.x
79
91
- name : Disable pre- and post-publish actions
80
92
run : ' sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
81
- - uses : JS-DevTools/npm-publish@v3 .1.1
93
+ - uses : JS-DevTools/npm-publish@v4 .1.0
82
94
if : github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
83
95
with :
84
96
token : ${{ secrets.NPM_TOKEN }}
0 commit comments