@@ -52,20 +52,20 @@ jobs:
5252 exit 1
5353
5454 - name : Check actor permission
55- uses : skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
55+ uses : skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
5656 with :
5757 require : write
5858
5959 - name : Add reaction on start
6060 uses : peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
6161 with :
62- token : ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
62+ token : ${{ secrets.COMMAND_BOT_PAT }}
6363 repository : ${{ github.event.repository.full_name }}
6464 comment-id : ${{ github.event.comment.id }}
6565 reactions : ' +1'
6666
6767 - name : Parse command
68- uses : skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v2
68+ uses : skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1
6969 id : command
7070
7171 # Init path depending on which command is run
8686 uses : peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
8787 if : failure()
8888 with :
89- token : ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
89+ token : ${{ secrets.COMMAND_BOT_PAT }}
9090 repository : ${{ github.event.repository.full_name }}
9191 comment-id : ${{ github.event.comment.id }}
9292 reactions : ' -1'
@@ -97,17 +97,16 @@ jobs:
9797
9898 steps :
9999 - name : Restore cached git repository
100- uses : actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
100+ uses : actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
101101 with :
102102 path : .git
103103 key : git-repo
104104
105105 - name : Checkout ${{ needs.init.outputs.head_ref }}
106- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
106+ uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
107107 with :
108- # Needed to allow force push later
109- persist-credentials : true
110- token : ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
108+ persist-credentials : false
109+ token : ${{ secrets.COMMAND_BOT_PAT }}
111110 fetch-depth : 0
112111 ref : ${{ needs.init.outputs.head_ref }}
113112
@@ -134,23 +133,25 @@ jobs:
134133
135134 - name : Rebase to ${{ needs.init.outputs.base_ref }}
136135 if : ${{ contains(needs.init.outputs.arg1, 'rebase') }}
136+ env :
137+ BASE_REF : ${{ needs.init.outputs.base_ref }}
137138 run : |
138- git fetch origin '${{ needs.init.outputs.base_ref }} :${{ needs.init.outputs.base_ref }}'
139+ git fetch origin "${BASE_REF} :${BASE_REF}"
139140
140141 # Start the rebase
141- git rebase ' origin/${{ needs.init.outputs.base_ref }}' || {
142+ git rebase " origin/${BASE_REF}" || {
142143 # Handle rebase conflicts in a loop
143144 while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do
144145 echo "Handling rebase conflict..."
145146
146147 # Remove and checkout /dist and /js folders from the base branch
147148 if [ -d "dist" ]; then
148149 rm -rf dist
149- git checkout origin/${{ needs.init.outputs.base_ref }} -- dist/ 2>/dev/null || echo "No dist folder in base branch"
150+ git checkout " origin/${BASE_REF}" -- dist/ 2>/dev/null || echo "No dist folder in base branch"
150151 fi
151152 if [ -d "js" ]; then
152153 rm -rf js
153- git checkout origin/${{ needs.init.outputs.base_ref }} -- js/ 2>/dev/null || echo "No js folder in base branch"
154+ git checkout " origin/${BASE_REF}" -- js/ 2>/dev/null || echo "No js folder in base branch"
154155 fi
155156
156157 # Stage all changes
@@ -182,20 +183,26 @@ jobs:
182183
183184 - name : Commit default
184185 if : ${{ !contains(needs.init.outputs.arg1, 'fixup') && !contains(needs.init.outputs.arg1, 'amend') }}
186+ env :
187+ GIT_PATH : ${{ needs.init.outputs.git_path }}
185188 run : |
186- git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
189+ git add "${GITHUB_WORKSPACE}${GIT_PATH}"
187190 git commit --signoff -m 'chore(assets): Recompile assets'
188191
189192 - name : Commit fixup
190193 if : ${{ contains(needs.init.outputs.arg1, 'fixup') }}
194+ env :
195+ GIT_PATH : ${{ needs.init.outputs.git_path }}
191196 run : |
192- git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
197+ git add "${GITHUB_WORKSPACE}${GIT_PATH}"
193198 git commit --fixup=HEAD --signoff
194199
195200 - name : Commit amend
196201 if : ${{ contains(needs.init.outputs.arg1, 'amend') }}
202+ env :
203+ GIT_PATH : ${{ needs.init.outputs.git_path }}
197204 run : |
198- git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
205+ git add "${GITHUB_WORKSPACE}${GIT_PATH}"
199206 git commit --amend --no-edit --signoff
200207 # Remove any [skip ci] from the amended commit
201208 git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')"
@@ -204,19 +211,25 @@ jobs:
204211 if : ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }}
205212 env :
206213 HEAD_REF : ${{ needs.init.outputs.head_ref }}
207- run : git push origin "$HEAD_REF"
214+ BOT_TOKEN : ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
215+ run : |
216+ git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git"
217+ git push origin "$HEAD_REF"
208218
209219 - name : Force push
210220 if : ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }}
211221 env :
212222 HEAD_REF : ${{ needs.init.outputs.head_ref }}
213- run : git push --force-with-lease origin "$HEAD_REF"
223+ BOT_TOKEN : ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
224+ run : |
225+ git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git"
226+ git push --force-with-lease origin "$HEAD_REF"
214227
215228 - name : Add reaction on failure
216229 uses : peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
217230 if : failure()
218231 with :
219- token : ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
232+ token : ${{ secrets.COMMAND_BOT_PAT }}
220233 repository : ${{ github.event.repository.full_name }}
221234 comment-id : ${{ github.event.comment.id }}
222235 reactions : ' -1'
0 commit comments