Skip to content

Commit 370fe09

Browse files
Merge pull request #14031 from nextcloud/backport/14029/stable33
[stable33] ci(actions): Pin CI actions
2 parents c052647 + a830308 commit 370fe09

File tree

9 files changed

+87
-31
lines changed

9 files changed

+87
-31
lines changed

.github/workflows/block-merge-eol.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,23 @@ jobs:
2727

2828
steps:
2929
- name: Set server major version environment
30-
run: |
31-
# retrieve version number from branch reference
32-
server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
33-
echo "server_major=$server_major" >> $GITHUB_ENV
34-
echo "current_month=$(date +%Y-%m)" >> $GITHUB_ENV
35-
36-
- name: Checking if ${{ env.server_major }} is EOL
30+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
31+
with:
32+
github-token: ${{secrets.GITHUB_TOKEN}}
33+
script: |
34+
const regex = /^stable(\d+)$/
35+
const baseRef = context.payload.pull_request.base.ref
36+
const match = baseRef.match(regex)
37+
if (match) {
38+
console.log('Setting server_major to ' + match[1]);
39+
core.exportVariable('server_major', match[1]);
40+
console.log('Setting current_day to ' + (new Date()).toISOString().substr(0, 10));
41+
core.exportVariable('current_day', (new Date()).toISOString().substr(0, 10));
42+
}
43+
44+
- name: Checking if server ${{ env.server_major }} is EOL
45+
if: ${{ env.server_major != '' }}
3746
run: |
3847
curl -s https://raw.githubusercontent.com/nextcloud-releases/updater_server/production/config/major_versions.json \
39-
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99" | . >= "${{ env.current_month }}"' \
48+
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99-99" | . >= "${{ env.current_day }}"' \
4049
| grep -q true

.github/workflows/block-merge-freeze.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,29 @@ jobs:
2929

3030
steps:
3131
- name: Register server reference to fallback to master branch
32-
run: |
33-
server_ref="$(if [ '${{ github.base_ref }}' = 'main' ]; then echo -n 'master'; else echo -n '${{ github.base_ref }}'; fi)"
34-
echo "server_ref=$server_ref" >> $GITHUB_ENV
32+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
33+
with:
34+
github-token: ${{secrets.GITHUB_TOKEN}}
35+
script: |
36+
const baseRef = context.payload.pull_request.base.ref
37+
if (baseRef === 'main' || baseRef === 'master') {
38+
core.exportVariable('server_ref', 'master');
39+
console.log('Setting server_ref to master');
40+
} else {
41+
const regex = /^stable(\d+)$/
42+
const match = baseRef.match(regex)
43+
if (match) {
44+
core.exportVariable('server_ref', match[0]);
45+
console.log('Setting server_ref to ' + match[0]);
46+
} else {
47+
console.log('Not based on master/main/stable*, so skipping freeze check');
48+
}
49+
}
50+
3551
- name: Download version.php from ${{ env.server_ref }}
52+
if: ${{ env.server_ref != '' }}
3653
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php
3754

3855
- name: Run check
56+
if: ${{ env.server_ref != '' }}
3957
run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC'

.github/workflows/check-occ-command.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ on:
55
paths:
66
- '**.rst'
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
check-occ-command:
1013
name: Check occ command syntax
1114
runs-on: ubuntu-latest
1215
steps:
13-
- uses: actions/[email protected]
16+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17+
with:
18+
persist-credentials: false
1419

1520
- name: Run script
1621
run: |

.github/workflows/codespell.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- master
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
codespell:
1114
name: Check spelling

.github/workflows/generate_catalog_templates.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- 'user_manual/**'
99
- '!user_manual/locale/**'
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
user_manual:
1316
runs-on: ubuntu-latest

.github/workflows/openapi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.2.2
1919
with:
20-
submodules: true
20+
persist-credentials: false
2121

2222
- name: Set up php
23-
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
23+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
2424
with:
2525
php-version: '8.1'
2626
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

.github/workflows/pr-feedback.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
schedule:
1616
- cron: '30 1 * * *'
1717

18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
1822
jobs:
1923
pr-feedback:
2024
if: ${{ github.repository_owner == 'nextcloud' }}
@@ -32,7 +36,7 @@ jobs:
3236
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
3337
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
3438
35-
- uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4
39+
- uses: nextcloud/pr-feedback-action@f0cab224dea8e1f282f9451de322f323c78fc7a5 # main
3640
with:
3741
feedback-message: |
3842
Hello there,
@@ -46,6 +50,6 @@ jobs:
4650
4751
(If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).)
4852
days-before-feedback: 14
49-
start-date: '2024-04-30'
53+
start-date: '2025-06-12'
5054
exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}'
5155
exempt-bots: true

.github/workflows/sphinxbuild.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ on:
77
- master
88
- stable*
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
user_manual:
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
with:
19+
persist-credentials: false
1520
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
1621
with:
1722
python-version: '3.12'
@@ -33,6 +38,8 @@ jobs:
3338
runs-on: ubuntu-latest
3439
steps:
3540
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
41+
with:
42+
persist-credentials: false
3643
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
3744
with:
3845
python-version: '3.12'
@@ -46,6 +53,8 @@ jobs:
4653
runs-on: ubuntu-latest
4754
steps:
4855
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56+
with:
57+
persist-credentials: false
4958
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
5059
with:
5160
python-version: '3.12'
@@ -67,6 +76,8 @@ jobs:
6776
runs-on: ubuntu-latest
6877
steps:
6978
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
79+
with:
80+
persist-credentials: false
7081
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
7182
with:
7283
python-version: '3.12'

.github/workflows/transifex.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@ name: AutoMerge Transifex Pull Requests
22
on:
33
pull_request:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
approve:
7-
runs-on: ubuntu-latest
10+
if: github.event.pull_request.user.login == 'transifex-integration[bot]'
11+
runs-on: ubuntu-latest-low
12+
permissions:
13+
# for hmarr/auto-approve-action to approve PRs
14+
pull-requests: write
15+
# for alexwilson/enable-github-automerge-action to approve PRs
16+
contents: write
17+
818
name: Approve
919
steps:
10-
- uses: hmarr/[email protected]
11-
if: github.actor == 'transifex-integration[bot]'
20+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
1221
with:
1322
github-token: "${{ secrets.GITHUB_TOKEN }}"
1423

15-
automerge:
16-
runs-on: ubuntu-latest
17-
name: Auto-merge
18-
needs: approve
19-
steps:
20-
- uses: pascalgn/[email protected]
21-
if: github.actor == 'transifex-integration[bot]'
22-
env:
23-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
24-
MERGE_LABELS: ""
25-
MERGE_RETRIES: 10
26-
MERGE_RETRY_SLEEP: 120000
24+
# Enable GitHub auto merge
25+
- name: Auto merge
26+
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
27+
if: startsWith(steps.branchname.outputs.branch, 'translations_')
28+
with:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)