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