Skip to content

Commit 8b7193a

Browse files
committed
fix: reduce token permissions in github workflows
1 parent 91bdfbe commit 8b7193a

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
jobs:
1818
setup:
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
2022
environment: ${{ github.event.inputs.environment != '' && github.event.inputs.environment || (github.ref == 'refs/heads/main' && 'Production' || 'Staging') }}
2123
outputs:
2224
charm_name: ${{ steps.setup-vars.outputs.charm_name }}
@@ -38,6 +40,9 @@ jobs:
3840
needs: setup
3941
name: Deploy
4042
uses: canonical/webteam-devops/.github/workflows/deploy.yaml@main
43+
permissions:
44+
contents: read
45+
deployments: write
4146
with:
4247
environment: ${{ needs.setup.outputs.environment }}
4348
charm_name: ${{ needs.setup.outputs.charm_name }}

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ jobs:
7676
7777
pack-rock:
7878
runs-on: ubuntu-latest
79+
permissions:
80+
contents: read
7981
steps:
8082
- uses: actions/checkout@v4
8183

0 commit comments

Comments
 (0)