Skip to content

Commit 010e00f

Browse files
authored
Merge pull request #620 from nextcloud/feat/workflow-auto-update-npm-audit-fix.yml
ci: update npm-audit-fix.yml workflow from template
2 parents 1e5e07a + ab979eb commit 010e00f

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/npm-audit-fix.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,31 @@ on:
1414
# At 2:30 on Sundays
1515
- cron: '30 2 * * 0'
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
runs-on: ubuntu-latest
2023

2124
strategy:
2225
fail-fast: false
2326
matrix:
24-
branches: ['main', 'master', 'stable31', 'stable30', 'stable29']
27+
branches:
28+
- ${{ github.event.repository.default_branch }}
29+
- 'stable31'
30+
- 'stable30'
2531

2632
name: npm-audit-fix-${{ matrix.branches }}
2733

2834
steps:
2935
- name: Checkout
30-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+
id: checkout
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3138
with:
39+
persist-credentials: false
3240
ref: ${{ matrix.branches }}
41+
continue-on-error: true
3342

3443
- name: Read package.json node and npm engines version
3544
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
@@ -39,7 +48,7 @@ jobs:
3948
fallbackNpm: '^10'
4049

4150
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
42-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
51+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4352
with:
4453
node-version: ${{ steps.versions.outputs.nodeVersion }}
4554

@@ -48,19 +57,19 @@ jobs:
4857

4958
- name: Fix npm audit
5059
id: npm-audit
51-
uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0
60+
uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0
5261

5362
- name: Run npm ci and npm run build
54-
if: always()
63+
if: steps.checkout.outcome == 'success'
5564
env:
5665
CYPRESS_INSTALL_BINARY: 0
5766
run: |
5867
npm ci
5968
npm run build --if-present
6069
6170
- name: Create Pull Request
62-
if: always()
63-
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
71+
if: steps.checkout.outcome == 'success'
72+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
6473
with:
6574
token: ${{ secrets.COMMAND_BOT_PAT }}
6675
commit-message: 'fix(deps): Fix npm audit'

0 commit comments

Comments
 (0)