Skip to content

Commit

Permalink
ci: set contents read as default workflow permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Feb 8, 2025
1 parent 9880ce2 commit dbfee65
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: build

concurrency:
group: build-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read

on:
push:
branches:
Expand All @@ -29,6 +33,12 @@ env:

jobs:
build:
runs-on: ubuntu-latest
permissions:
# required to create GitHub release
contents: write
# required to push to GHCR
packages: write
strategy:
fail-fast: false
matrix:
Expand All @@ -40,7 +50,6 @@ jobs:
- '3.20'
- '3.21'
- 'edge'
runs-on: ubuntu-latest
steps:
-
name: Checkout
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: labels

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read

on:
push:
branches:
Expand All @@ -15,6 +23,11 @@ on:
jobs:
labeler:
runs-on: ubuntu-latest
permissions:
# same as global permissions
contents: read
# required to update labels
issues: write
steps:
-
name: Checkout
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read

on:
push:
branches:
Expand Down

0 comments on commit dbfee65

Please sign in to comment.