|
18 | 18 | - next |
19 | 19 |
|
20 | 20 | permissions: |
21 | | - contents: write # to be able to publish a GitHub release |
22 | | - issues: write # to be able to comment on released issues |
23 | | - pull-requests: write # to be able to comment on released pull requests |
24 | | - id-token: write # to enable use of OIDC for trusted publishing and npm provenance |
| 21 | + contents: read |
25 | 22 |
|
26 | 23 | jobs: |
27 | | - |
28 | 24 | test-nodejs: |
29 | 25 | # We just check the message of first commit as there is always just one commit because we squash into one before merging |
30 | 26 | # "commits" contains array of objects where one of the properties is commit "message" |
|
48 | 44 | shell: bash |
49 | 45 | - name: Checkout repository |
50 | 46 | uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + persist-credentials: false |
51 | 49 | - name: Check if Node.js project and has package.json |
52 | 50 | id: packagejson |
53 | | - run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT |
| 51 | + run: test -e ./package.json && echo "exists=true" >> "$GITHUB_OUTPUT" || echo "exists=false" >> "$GITHUB_OUTPUT" |
54 | 52 | shell: bash |
55 | 53 | - if: steps.packagejson.outputs.exists == 'true' |
56 | 54 | name: Determine what node version to use |
@@ -90,16 +88,23 @@ jobs: |
90 | 88 | needs: [test-nodejs] |
91 | 89 | name: Publish to any of NPM, Github, or Docker Hub |
92 | 90 | runs-on: ubuntu-latest |
| 91 | + permissions: |
| 92 | + contents: write # to be able to publish a GitHub release |
| 93 | + issues: write # to be able to comment on released issues |
| 94 | + pull-requests: write # to be able to comment on released pull requests |
| 95 | + id-token: write # to enable use of OIDC for trusted publishing and npm provenance |
93 | 96 | steps: |
94 | 97 | - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows |
95 | 98 | run: | |
96 | 99 | git config --global core.autocrlf false |
97 | 100 | git config --global core.eol lf |
98 | 101 | - name: Checkout repository |
99 | 102 | uses: actions/checkout@v4 |
| 103 | + with: |
| 104 | + persist-credentials: false |
100 | 105 | - name: Check if Node.js project and has package.json |
101 | 106 | id: packagejson |
102 | | - run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT |
| 107 | + run: test -e ./package.json && echo "exists=true" >> "$GITHUB_OUTPUT" || echo "exists=false" >> "$GITHUB_OUTPUT" |
103 | 108 | shell: bash |
104 | 109 | - if: steps.packagejson.outputs.exists == 'true' |
105 | 110 | name: Determine what node version to use |
|
0 commit comments