Skip to content

Commit 5d38830

Browse files
Merge pull request #2988 from nextcloud/maintenance/pin-gh-actions-to-sha
Pin versions of GH actions and some minor updates
2 parents a74fb6e + e9b3f75 commit 5d38830

File tree

11 files changed

+81
-59
lines changed

11 files changed

+81
-59
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Maintenance
2+
3+
- Pin GitHub actions to enhance security protection against dependency attacks

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,33 @@ updates:
77
time: "03:00"
88
timezone: Europe/Paris
99
open-pull-requests-limit: 10
10+
cooldown:
11+
default-days: 7
1012
- package-ecosystem: composer
1113
directory: "/"
1214
schedule:
1315
interval: daily
1416
time: "03:00"
1517
timezone: Europe/Paris
1618
open-pull-requests-limit: 10
19+
cooldown:
20+
default-days: 7
1721
- package-ecosystem: bundler
1822
directory: "/docs"
1923
schedule:
2024
timezone: Europe/Berlin
2125
interval: daily
2226
time: "02:50"
2327
open-pull-requests-limit: 10
28+
cooldown:
29+
default-days: 7
2430
- package-ecosystem: github-actions
2531
directory: "/"
2632
schedule:
2733
timezone: Europe/Berlin
2834
interval: daily
2935
time: "02:50"
3036
open-pull-requests-limit: 10
37+
cooldown:
38+
default-days: 7
3139

.github/workflows/build-test-images.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ jobs:
3232
fi
3333
3434
- name: Checkout the app
35-
uses: actions/checkout@v6
35+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
3636
if: ${{ steps.check.outputs.skip == 'false' }}
37+
with:
38+
persist-credentials: false
3739
- name: Make sure the appinfo is built
3840
shell: bash
3941
run: make appinfo/info.xml

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ concurrency:
2323

2424
jobs:
2525
auto-approve-merge:
26-
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
26+
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
2727
runs-on: ubuntu-latest-low
2828
permissions:
2929
# for hmarr/auto-approve-action to approve PRs

.github/workflows/depending-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
check:
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: z0al/dependent-issues@v1.5.2
32+
- uses: z0al/dependent-issues@950226e7ca8fc43dc209a7febf67c655af3bdb43
3333
env:
3434
# (Required) The token to use to make API calls to GitHub.
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy-appstore.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,16 @@ jobs:
2020

2121
steps:
2222
- name: Checkout the project
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
2424
with:
2525
path: cookbook
2626
ref: ${{ github.ref }}
2727
fetch-depth: 0
28+
persist-credentials: false
2829

2930
- name: Get the date
3031
id: date
3132
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
32-
- name: Use cache for NPM
33-
uses: actions/cache@v5.0.1
34-
with:
35-
path: |
36-
~/.npm
37-
cookbook/node_modules
38-
key: ${{ runner.os }}-node-${{ steps.date.outputs.date }}-${{ hashFiles('cookbook/package-lock.json') }}
39-
restore-keys: |
40-
${{ runner.os }}-node-${{ steps.date.outputs.date }}-
41-
${{ runner.os }}-node-
4233

4334
- name: Install the NPM packages
4435
run: npm ci
@@ -51,7 +42,7 @@ jobs:
5142
- name: Extract app version
5243
id: appversion
5344
run: |
54-
version=$(echo ${{ github.ref }} | sed 's@^refs/tags/@@;s@^v@@i')
45+
version=$(echo ${GITHUB_REF} | sed 's@^refs/tags/@@;s@^v@@i')
5546
echo -n "version=" >> $GITHUB_OUTPUT
5647
echo "$version" >> $GITHUB_OUTPUT
5748
if echo $version | grep '^[0-9]*\.[0-9]*\.[0-9]*$' > /dev/null
@@ -70,7 +61,7 @@ jobs:
7061
run: ls -lh /tmp/cookbook-${{ steps.appversion.outputs.version }}.tar.gz
7162

7263
- name: Create release
73-
uses: softprops/action-gh-release@v2.5.0
64+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b
7465
id: release
7566
with:
7667
files: /tmp/cookbook-${{ steps.appversion.outputs.version }}.tar.gz

.github/workflows/pages.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ on:
1414
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1515
permissions:
1616
contents: read
17-
pages: write
18-
id-token: write
1917

2018
# Allow one concurrent deployment
2119
concurrency:
@@ -32,9 +30,11 @@ jobs:
3230
runs-on: ubuntu-24.04
3331
steps:
3432
- name: Checkout
35-
uses: actions/checkout@v6
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
34+
with:
35+
persist-credentials: false
3636
- name: Setup Pages
37-
uses: actions/configure-pages@v5
37+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b
3838

3939
- name: Count number of plantuml files
4040
id: count-plantuml
@@ -52,12 +52,12 @@ jobs:
5252
run: make -C docs build-uml-svg
5353

5454
- name: Build with Jekyll
55-
uses: actions/jekyll-build-pages@v1
55+
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697
5656
with:
5757
source: ./docs/
5858
destination: ./docs/_site
5959
- name: Upload artifact
60-
uses: actions/upload-pages-artifact@v4
60+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b
6161
with:
6262
path: ./docs/_site/
6363

@@ -69,7 +69,10 @@ jobs:
6969
runs-on: ubuntu-24.04
7070
if: github.event.ref == 'refs/heads/master' && github.repository == 'nextcloud/cookbook'
7171
needs: build
72+
permissions:
73+
pages: write
74+
id-token: write
7275
steps:
7376
- name: Deploy to GitHub Pages
7477
id: deployment
75-
uses: actions/deploy-pages@v4
78+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e

.github/workflows/publish-test-results.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ jobs:
2626
- name: Download and Extract Artifacts
2727
env:
2828
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
29+
GITHUB_EVENT_WORKFLOW_RUN_ARTIFACTS_URL: ${{ github.event.workflow_run.artifacts_url }}
2930
run: |
3031
mkdir -p artifacts && cd artifacts
3132
32-
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
33+
artifacts_url=${GITHUB_EVENT_WORKFLOW_RUN_ARTIFACTS_URL}
3334
3435
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
3536
do
@@ -39,7 +40,7 @@ jobs:
3940
done
4041
4142
- name: Publish Unit Test Results
42-
uses: EnricoMi/publish-unit-test-result-action@v2
43+
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f
4344
with:
4445
commit: ${{ github.event.workflow_run.head_sha }}
4546
event_file: artifacts/Event File/event.json

.github/workflows/pull-checks.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ jobs:
1212

1313
steps:
1414
- name: Checkout the app
15-
uses: actions/checkout@v6
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1616
with:
1717
filter: "blob:none"
1818
fetch-depth: 0
19+
persist-credentials: false
1920

2021
- name: Get the diff
2122
id: diff
@@ -167,9 +168,10 @@ jobs:
167168

168169
steps:
169170
- name: Checkout of the app
170-
uses: actions/checkout@v6
171+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
171172
with:
172173
fetch-depth: 1
174+
persist-credentials: false
173175

174176
- name: Install dependencies
175177
run: |
@@ -200,7 +202,7 @@ jobs:
200202
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
201203

202204
- name: Lint info.xml
203-
uses: ChristophWurst/xmllint-action@v1
205+
uses: ChristophWurst/xmllint-action@7c54ff113fc0f6d4588a15cb4dfe31b6ecca5212
204206
with:
205207
xml-file: ./appinfo/info.xml
206208
xml-schema-file: ./info.xsd
@@ -211,14 +213,15 @@ jobs:
211213

212214
steps:
213215
- name: Checkout of the app
214-
uses: actions/checkout@v6
216+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
215217
with:
216218
fetch-depth: 1
219+
persist-credentials: false
217220
- name: Get the date
218221
id: date
219222
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
220223
- name: Cache NPM cache
221-
uses: actions/cache@v5.0.1
224+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
222225
with:
223226
path: |
224227
~/.npm
@@ -247,6 +250,6 @@ jobs:
247250

248251
steps:
249252
- name: Run check
250-
uses: xt0rted/block-autosquash-commits-action@v2
253+
uses: xt0rted/block-autosquash-commits-action@79880c36b4811fe549cfffe20233df88876024e7
251254
with:
252255
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414

15-
- uses: actions/stale@v10
15+
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d
1616
name: Close stale issues
1717
with:
1818
days-before-stale: 45

0 commit comments

Comments
 (0)