Skip to content

Commit 74a8fc0

Browse files
Disservinvondele
authored andcommitted
Use explicit action permissions in CI
Necessary modifications according to changes in the GitHub Action settings. closes #5437 Follow up from the report by Yaron Avital (yaronav) earlier. No functional change
1 parent ee6fc7e commit 74a8fc0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/stockfish.yml

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
Prerelease:
1616
if: github.repository == 'official-stockfish/Stockfish' && (github.ref == 'refs/heads/master' || (startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'))
1717
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write # For deleting/creating a prerelease
1820
steps:
1921
- uses: actions/checkout@v4
2022
with:
@@ -104,9 +106,17 @@ jobs:
104106
uses: ./.github/workflows/upload_binaries.yml
105107
with:
106108
matrix: ${{ needs.Matrix.outputs.matrix }}
109+
permissions:
110+
contents: write # For deleting/creating a (pre)release
111+
secrets:
112+
token: ${{ secrets.GITHUB_TOKEN }}
107113
ARM_Binaries:
108114
if: github.repository == 'official-stockfish/Stockfish'
109115
needs: [Matrix, Prerelease, ARMCompilation]
110116
uses: ./.github/workflows/upload_binaries.yml
111117
with:
112118
matrix: ${{ needs.Matrix.outputs.arm_matrix }}
119+
permissions:
120+
contents: write # For deleting/creating a (pre)release
121+
secrets:
122+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/upload_binaries.yml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
matrix:
66
type: string
77
required: true
8+
secrets:
9+
token:
10+
required: true
811

912
jobs:
1013
Artifacts:
@@ -80,6 +83,7 @@ jobs:
8083
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
8184
with:
8285
files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
86+
token: ${{ secrets.token }}
8387

8488
- name: Get last commit sha
8589
id: last_commit
@@ -106,3 +110,4 @@ jobs:
106110
tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
107111
prerelease: true
108112
files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
113+
token: ${{ secrets.token }}

0 commit comments

Comments
 (0)