|
1 | 1 | # This workflow is provided via the organization template repository |
2 | 2 | # |
3 | | -# https://github.com/nextcloud/.github |
| 3 | +# https://github.com/nextcloud-libraries/.github |
4 | 4 | # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization |
5 | 5 | # |
6 | 6 | # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors |
|
14 | 14 | # At 2:30 on Sundays |
15 | 15 | - cron: '30 2 * * 0' |
16 | 16 |
|
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + |
17 | 20 | jobs: |
18 | 21 | build: |
19 | 22 | runs-on: ubuntu-latest |
20 | 23 |
|
21 | 24 | strategy: |
22 | 25 | fail-fast: false |
23 | 26 | matrix: |
24 | | - branches: ['main', 'master', 'stable30', 'stable29', 'stable28'] |
| 27 | + branches: ['main'] |
25 | 28 |
|
26 | 29 | name: npm-audit-fix-${{ matrix.branches }} |
27 | 30 |
|
28 | 31 | steps: |
29 | 32 | - name: Checkout |
30 | | - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 33 | + id: checkout |
| 34 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
31 | 35 | with: |
| 36 | + persist-credentials: false |
32 | 37 | ref: ${{ matrix.branches }} |
| 38 | + continue-on-error: true |
33 | 39 |
|
34 | | - - name: Read package.json node and npm engines version |
35 | | - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 |
| 40 | + - name: Read package.json |
| 41 | + uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0 |
36 | 42 | id: versions |
37 | | - with: |
38 | | - fallbackNode: '^20' |
39 | | - fallbackNpm: '^10' |
40 | 43 |
|
41 | | - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} |
42 | | - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 |
| 44 | + - name: Set up node |
| 45 | + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 |
43 | 46 | with: |
44 | | - node-version: ${{ steps.versions.outputs.nodeVersion }} |
| 47 | + node-version: ${{ steps.versions.outputs.node-version }} |
45 | 48 |
|
46 | | - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} |
47 | | - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' |
| 49 | + - name: Set up npm |
| 50 | + run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' |
48 | 51 |
|
49 | 52 | - name: Fix npm audit |
50 | 53 | id: npm-audit |
51 | | - uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0 |
| 54 | + uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0 |
52 | 55 |
|
53 | 56 | - name: Run npm ci and npm run build |
54 | | - if: always() |
| 57 | + if: steps.checkout.outcome == 'success' |
55 | 58 | env: |
56 | 59 | CYPRESS_INSTALL_BINARY: 0 |
57 | 60 | run: | |
58 | 61 | npm ci |
59 | 62 | npm run build --if-present |
60 | 63 |
|
61 | 64 | - name: Create Pull Request |
62 | | - if: always() |
63 | | - uses: peter-evans/create-pull-request@6cd32fd93684475c31847837f87bb135d40a2b79 # v7.0.3 |
| 65 | + if: steps.checkout.outcome == 'success' |
| 66 | + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 |
64 | 67 | with: |
65 | 68 | token: ${{ secrets.COMMAND_BOT_PAT }} |
66 | 69 | commit-message: 'fix(deps): Fix npm audit' |
|
0 commit comments