@@ -15,33 +15,34 @@ jobs:
15
15
arg1 : ${{ steps.command.outputs.arg1 }}
16
16
arg2 : ${{ steps.command.outputs.arg2 }}
17
17
head_ref : ${{ steps.comment-branch.outputs.head_ref }}
18
+ base_ref : ${{ steps.comment-branch.outputs.base_ref }}
18
19
19
20
steps :
20
21
- name : Check actor permission
21
- uses : skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2
22
+ uses : skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
22
23
with :
23
24
require : write
24
25
25
26
- name : Add reaction on start
26
- uses : peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3 .0.2
27
+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 .0.0
27
28
with :
28
29
token : ${{ secrets.COMMAND_BOT_PAT }}
29
30
repository : ${{ github.event.repository.full_name }}
30
31
comment-id : ${{ github.event.comment.id }}
31
32
reactions : " +1"
32
33
33
34
- name : Parse command
34
- uses : skjnldsv/parse-command-comment@7cef1df370a99dfd5bf896d50121390c96785db8 # v2
35
+ uses : skjnldsv/parse-command-comment@d8c0034c481b791dd6348fcacd9c510dc3a4cb4f # v2
35
36
id : command
36
37
37
38
# Init path depending on which command is run
38
39
- name : Init path
39
40
id : git-path
40
41
run : |
41
42
if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then
42
- echo "path=${{ github.workspace }}${{ steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT
43
+ echo "path=${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT
43
44
else
44
- echo "path=${{ github.workspace }}${{ steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT
45
+ echo "path=${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT
45
46
fi
46
47
47
48
- name : Init branch
@@ -54,13 +55,13 @@ jobs:
54
55
55
56
steps :
56
57
- name : Restore cached git repository
57
- uses : actions /cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
58
+ uses : buildjet /cache@e376f15c6ec6dc595375c78633174c7e5f92dc0e # v3
58
59
with :
59
60
path : .git
60
61
key : git-repo
61
62
62
63
- name : Checkout ${{ needs.init.outputs.head_ref }}
63
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
64
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
64
65
with :
65
66
token : ${{ secrets.COMMAND_BOT_PAT }}
66
67
fetch-depth : 0
@@ -76,45 +77,61 @@ jobs:
76
77
id : package-engines-versions
77
78
with :
78
79
fallbackNode : ' ^20'
79
- fallbackNpm : ' ^9 '
80
+ fallbackNpm : ' ^10 '
80
81
81
82
- name : Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
82
- uses : actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3
83
+ uses : actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3
83
84
with :
84
85
node-version : ${{ steps.package-engines-versions.outputs.nodeVersion }}
85
86
cache : npm
86
87
87
88
- name : Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
88
89
run : npm i -g npm@"${{ steps.package-engines-versions.outputs.npmVersion }}"
90
+
91
+ - name : Rebase to ${{ needs.init.outputs.base_ref }}
92
+ if : ${{ contains(needs.init.outputs.arg1, 'rebase') }}
93
+ run : |
94
+ git fetch origin ${{ needs.init.outputs.base_ref }}:${{ needs.init.outputs.base_ref }}
95
+ git rebase origin/${{ needs.init.outputs.base_ref }}
89
96
90
97
- name : Install dependencies & build
98
+ env :
99
+ CYPRESS_INSTALL_BINARY : 0
100
+ PUPPETEER_SKIP_DOWNLOAD : true
91
101
run : |
92
102
npm ci
93
103
npm run build --if-present
94
104
95
- - name : Commit and push default
96
- if : ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }}
105
+ - name : Commit default
106
+ if : ${{ !contains( needs.init.outputs.arg1, 'fixup') && !contains( needs.init.outputs.arg1, 'amend') }}
97
107
run : |
98
- git add ${{ needs.init.outputs.git_path }}
108
+ git add ${{ github.workspace }}${{ needs.init.outputs.git_path }}
99
109
git commit --signoff -m 'chore(assets): Recompile assets'
100
- git push origin ${{ needs.init.outputs.head_ref }}
101
-
102
- - name : Commit and push fixup
103
- if : ${{ needs.init.outputs.arg1 == 'fixup' }}
110
+
111
+ - name : Commit fixup
112
+ if : ${{ contains(needs.init.outputs.arg1, 'fixup') }}
104
113
run : |
105
- git add ${{ needs.init.outputs.git_path }}
114
+ git add ${{ github.workspace }}${{ needs.init.outputs.git_path }}
106
115
git commit --fixup=HEAD --signoff
107
- git push origin ${{ needs.init.outputs.head_ref }}
108
116
109
- - name : Commit and push amend
110
- if : ${{ needs.init.outputs.arg1 == 'amend' }}
117
+ - name : Commit amend
118
+ if : ${{ contains( needs.init.outputs.arg1, 'amend') }}
111
119
run : |
112
- git add ${{ needs.init.outputs.git_path }}
120
+ git add ${{ github.workspace }}${{ needs.init.outputs.git_path }}
113
121
git commit --amend --no-edit --signoff
114
- git push --force origin ${{ needs.init.outputs.head_ref }}
122
+ # Remove any [skip ci] from the amended commit
123
+ git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')"
124
+
125
+ - name : Push normally
126
+ if : ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }}
127
+ run : git push origin ${{ needs.init.outputs.head_ref }}
128
+
129
+ - name : Force push
130
+ if : ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }}
131
+ run : git push --force origin ${{ needs.init.outputs.head_ref }}
115
132
116
133
- name : Add reaction on failure
117
- uses : peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3 .0.2
134
+ uses : peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4 .0.0
118
135
if : failure()
119
136
with :
120
137
token : ${{ secrets.COMMAND_BOT_PAT }}
0 commit comments