Skip to content

Commit c076f60

Browse files
authored
chore: update command-compile from templates
Signed-off-by: John Molakvoæ <[email protected]>
1 parent 0bd39d3 commit c076f60

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

.github/workflows/command-compile.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
issue_comment:
1212
types: [created]
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
init:
1619
runs-on: ubuntu-latest
@@ -45,8 +48,8 @@ jobs:
4548
- name: Disabled on forks
4649
if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }}
4750
run: |
48-
echo 'Can not execute /compile on forks'
49-
exit 1
51+
echo 'Can not execute /compile on forks'
52+
exit 1
5053
5154
- name: Check actor permission
5255
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
@@ -76,23 +79,34 @@ jobs:
7679
fi
7780
7881
- name: Init branch
79-
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v1
82+
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
8083
id: comment-branch
8184

85+
- name: Add reaction on failure
86+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
87+
if: failure()
88+
with:
89+
token: ${{ secrets.COMMAND_BOT_PAT }}
90+
repository: ${{ github.event.repository.full_name }}
91+
comment-id: ${{ github.event.comment.id }}
92+
reactions: '-1'
93+
8294
process:
8395
runs-on: ubuntu-latest
8496
needs: init
8597

8698
steps:
8799
- name: Restore cached git repository
88-
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4
100+
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
89101
with:
90102
path: .git
91103
key: git-repo
92104

93105
- name: Checkout ${{ needs.init.outputs.head_ref }}
94106
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95107
with:
108+
# Needed to allow force push later
109+
persist-credentials: true
96110
token: ${{ secrets.COMMAND_BOT_PAT }}
97111
fetch-depth: 0
98112
ref: ${{ needs.init.outputs.head_ref }}
@@ -110,14 +124,14 @@ jobs:
110124
fallbackNpm: '^10'
111125

112126
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
113-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v3
127+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
114128
with:
115129
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
116130
cache: npm
117131

118132
- name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
119133
run: npm i -g 'npm@${{ steps.package-engines-versions.outputs.npmVersion }}'
120-
134+
121135
- name: Rebase to ${{ needs.init.outputs.base_ref }}
122136
if: ${{ contains(needs.init.outputs.arg1, 'rebase') }}
123137
run: |
@@ -137,7 +151,7 @@ jobs:
137151
run: |
138152
git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
139153
git commit --signoff -m 'chore(assets): Recompile assets'
140-
154+
141155
- name: Commit fixup
142156
if: ${{ contains(needs.init.outputs.arg1, 'fixup') }}
143157
run: |

0 commit comments

Comments
 (0)