Skip to content

Commit 6d4bf5e

Browse files
nextcloud-commandskjnldsv
authored andcommitted
ci(actions): Update workflow templates from organization template repository
Signed-off-by: GitHub <noreply@github.com>
1 parent 34031ef commit 6d4bf5e

16 files changed

Lines changed: 139 additions & 165 deletions

.github/actions-lock.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
# SPDX-License-Identifier: MIT
33
9f2b534bea27e8ec2dda7c1d772a664b block-merge-eol.yml
44
25fc4c7e69e778e20bdc9eb0cc96367e block-merge-freeze.yml
5-
169b5a5085493975bb375af516b288cc command-compile.yml
6-
7dd8d21d9dd013196cd4bdbf7c24db6f dependabot-approve-merge.yml
5+
46e653f77f1e1054dcf113bf2bab7eab command-compile.yml
6+
e6351c608939c31ae1e32923aa82aa10 dependabot-approve-merge.yml
77
2581a67c5bcdcd570427e6d51db767d7 fixup.yml
8-
54f293d9abe11ac0035a7bbb96a4e453 lint-eslint.yml
9-
ccd8a55c60e35b84becb0f7005ce1286 lint-php-cs.yml
10-
5dcc3187a9460cb62a455235cbdb3562 lint-php.yml
11-
cf229fbf443d2f7a303f22eb92745811 lint-stylelint.yml
12-
c965845a0def7b39d872e47e93dd1139 node.yml
13-
8d41f3688950b42dce423fb9fc1f785c npm-audit-fix.yml
14-
5846b994639ccab0059bf23e141d389a phpunit-mysql.yml
15-
ec7d1084fbb3a6803dbabf3acdd17ac8 phpunit-oci.yml
16-
29b359a5b76e7ff8cd85af34b3bf36e3 phpunit-pgsql.yml
17-
182cc739d33a2441d3a9278a9bff55b4 phpunit-sqlite.yml
8+
2a205b6cc57c26c31a18a7f41190f3e2 lint-eslint.yml
9+
870b483dbcbca59479211270d61546dd lint-php-cs.yml
10+
ee2b04d185b82fe7dd6fe6d83c6c7b45 lint-php.yml
11+
351799835db66dd8d20e324970490e96 lint-stylelint.yml
12+
03759c9dc0fa748cb927b9f9cadf2925 node.yml
13+
7e9fa275fffbfef58e6348a44750e2ec npm-audit-fix.yml
14+
07e60b2f304c749ee563f1256caf2793 phpunit-mysql.yml
15+
b98798d397dd45f12c777038d230509e phpunit-oci.yml
16+
4bf29a4d193f83443d16d368c60a7870 phpunit-pgsql.yml
17+
21244b02c3f1ad7d78951ba1b876638f phpunit-sqlite.yml
1818
3c4a096b3b7dbaef0f8e5190ffe13518 pr-feedback.yml
19-
2070d9569f327e758b9ce2b924c28fef psalm.yml
20-
7db5b820f3750eebe988005a0bb2febd reuse.yml
21-
a064cb13abb8fa131c50af7f826f0331 sync-workflow-templates.yml
19+
20b5d0d45766e3793f19c9c0c8d05140 psalm.yml
20+
3975dc58817119d596a8f6ed190352ce reuse.yml
21+
9799b1a6a842b5c0076b76de651a0e0d sync-workflow-templates.yml

.github/workflows/command-compile.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -86,7 +86,7 @@ jobs:
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
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

@@ -124,7 +123,7 @@ jobs:
124123
fallbackNpm: '^11.3'
125124

126125
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
127-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
126+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
128127
with:
129128
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
130129
cache: npm
@@ -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'

.github/workflows/dependabot-approve-merge.yml

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ jobs:
2626
auto-approve-merge:
2727
if: github.event.pull_request.user.login == 'dependabot[bot]'
2828
runs-on: ubuntu-latest-low
29+
env:
30+
# env variable for maintainers: 'true' allows to auto-merge 1.0.2 -> 2.0.0
31+
ALLOW_MAJOR: false
32+
# env variable for maintainers: 'true' allows to auto-merge 1.0.2 -> 1.1.0
33+
ALLOW_MINOR: true
34+
# env variable for maintainers: RegExp string to ignore some dependencies from auto-approve and auto-merge
35+
IGNORE_PATTERN: ''
2936
permissions:
30-
# for hmarr/auto-approve-action to approve PRs
37+
# for auto-approve step to work
3138
pull-requests: write
3239
# for alexwilson/enable-github-automerge-action to approve PRs
3340
contents: write
@@ -44,15 +51,51 @@ jobs:
4451
with:
4552
repo-token: ${{ secrets.GITHUB_TOKEN }}
4653

47-
# GitHub actions bot approve
48-
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
54+
- name: Dependabot metadata
55+
id: metadata
4956
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
57+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
5058
with:
5159
github-token: ${{ secrets.GITHUB_TOKEN }}
5260

61+
- name: Check for ignored dependencies in the PR
62+
id: validate
63+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
64+
env:
65+
IGNORE_PATTERN: ${{ env.IGNORE_PATTERN }}
66+
DEPENDENCY_NAMES: ${{ steps.metadata.outputs.dependency-names }}
67+
run: |
68+
if [[ -z ${IGNORE_PATTERN} ]]; then
69+
echo "ignore=false" >> "$GITHUB_OUTPUT"
70+
elif [[ -z ${DEPENDENCY_NAMES} ]]; then
71+
echo "ignore=false" >> "$GITHUB_OUTPUT"
72+
elif [[ ${DEPENDENCY_NAMES} =~ ${IGNORE_PATTERN} ]]; then
73+
echo "ignore=true" >> "$GITHUB_OUTPUT"
74+
fi
75+
76+
- name: GitHub actions bot approve
77+
id: auto_approve
78+
if: ${{
79+
startsWith(steps.branchname.outputs.branch, 'dependabot/')
80+
&& steps.validate.outputs.ignore != 'true'
81+
}}
82+
run: gh pr review --approve "$PR_URL"
83+
env:
84+
PR_URL: ${{ github.event.pull_request.html_url }}
85+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
5387
# Enable GitHub auto merge
5488
- name: Auto merge
55-
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
56-
if: startsWith(steps.branchname.outputs.branch, 'dependabot/') && (github.event.pull_request.action == 'opened' || github.event.pull_request.action == 'reopened')
89+
uses: alexwilson/enable-github-automerge-action@2c32e18a76e0726ffe7a573bfff2d42a20885126 # 3.0.0
90+
if: ${{
91+
startsWith(steps.branchname.outputs.branch, 'dependabot/')
92+
&& steps.auto_approve.conclusion == 'success'
93+
&& (github.event.action == 'opened' || github.event.action == 'reopened')
94+
&& (
95+
steps.metadata.outputs.update-type == 'version-update:semver-patch'
96+
|| (fromJSON(env.ALLOW_MINOR) && steps.metadata.outputs.update-type == 'version-update:semver-minor')
97+
|| (fromJSON(env.ALLOW_MAJOR) && steps.metadata.outputs.update-type == 'version-update:semver-major')
98+
)
99+
}}
57100
with:
58101
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-eslint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656

5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
59+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
6060
with:
6161
persist-credentials: false
6262

@@ -68,7 +68,7 @@ jobs:
6868
fallbackNpm: '^11.3'
6969

7070
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
71+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7272
with:
7373
node-version: ${{ steps.versions.outputs.nodeVersion }}
7474

.github/workflows/lint-php-cs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2929
with:
3030
persist-credentials: false
3131

@@ -34,7 +34,7 @@ jobs:
3434
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
3535

3636
- name: Set up php${{ steps.versions.outputs.php-min }}
37-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
37+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
3838
with:
3939
php-version: ${{ steps.versions.outputs.php-min }}
4040
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/lint-php.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
php-max: ${{ steps.versions.outputs.php-max }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2929
with:
3030
persist-credentials: false
3131

@@ -34,7 +34,7 @@ jobs:
3434
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
3535

3636
php-lint:
37-
runs-on: ubuntu-latest
37+
runs-on: ubuntu-latest-low
3838
needs: matrix
3939
strategy:
4040
matrix:
@@ -44,12 +44,12 @@ jobs:
4444

4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4848
with:
4949
persist-credentials: false
5050

5151
- name: Set up php ${{ matrix.php-versions }}
52-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
52+
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
5353
with:
5454
php-version: ${{ matrix.php-versions }}
5555
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/lint-stylelint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2929
with:
3030
persist-credentials: false
3131

@@ -37,7 +37,7 @@ jobs:
3737
fallbackNpm: '^11.3'
3838

3939
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
40-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
40+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4141
with:
4242
node-version: ${{ steps.versions.outputs.nodeVersion }}
4343

0 commit comments

Comments
 (0)