File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : ' npm run package'
2
+ # Main use case: repackage when Dependabot updates a dependency
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' dependabot/**'
7
+ workflow_dispatch :
8
+ inputs :
9
+ branch :
10
+ description : ' Process this branch'
11
+ required : false
12
+ type : string
13
+
14
+ permissions :
15
+ contents : write
16
+
17
+ jobs :
18
+ npm-run-package-and-push : # make sure build/ci work properly
19
+ runs-on : ubuntu-latest
20
+ steps :
21
+ - uses : actions/checkout@v2
22
+ with :
23
+ ref : ${{ inputs.branch }}
24
+ - run : npm ci
25
+ - run : npm run build
26
+ - run : npm run lint
27
+ - run : npm run format && git diff-files
28
+ - run : npm run test
29
+ - run : npm run package
30
+ - name : check if commit & push is needed
31
+ id : check
32
+ run : |
33
+ git add -u -- dist/ &&
34
+ git diff-index --cached --exit-code HEAD -- ||
35
+ echo "::set-output name=need-to-commit::yes"
36
+ - name : commit & push
37
+ if : steps.check.outputs.need-to-commit == 'yes'
38
+ run : |
39
+ git config user.name "${{github.actor}}" &&
40
+ git config user.email "${{github.actor}}@users.noreply.github.com" &&
41
+ git commit -m 'npm run build && npm run package' -- dist/ &&
42
+ git update-index --refresh &&
43
+ git diff-files --exit-code &&
44
+ git diff-index --cached --exit-code HEAD -- &&
45
+ git push
You can’t perform that action at this time.
0 commit comments