Skip to content

Commit cc1e9ca

Browse files
committed
fix: workflow permissions
1 parent c7005bd commit cc1e9ca

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ on:
55
branches:
66
- main
77
- staging
8+
workflow_call:
9+
inputs:
10+
environment:
11+
description: 'Environment (Production, Staging or Staging API)'
12+
required: true
13+
type: string
14+
# default value is invalid, this will stop the workflow if a wrong input is provided
15+
default: "_"
816
workflow_dispatch:
917
inputs:
1018
environment:
@@ -63,10 +71,14 @@ jobs:
6371
# we will dispatch another copy of this workflow to deploy the Staging API env; we invoke the workflow
6472
# with an input, so `github.event.inputs.environment` won't be "" and the `if` condition above will be
6573
# false, thus there won't be a recursive loop
66-
uses: canonical/snapcraft.io/.github/workflows/deploy.yaml@main
74+
uses: canonical/snapcraft.io/.github/workflows/deploy.yaml@staging
75+
permissions:
76+
contents: read
77+
deployments: write
78+
packages: write
6779
with:
6880
environment: Staging API
6981
secrets:
7082
VAULT_APPROLE_ROLE_ID: ${{ secrets.VAULT_APPROLE_ROLE_ID }}
7183
VAULT_APPROLE_SECRET_ID: ${{ secrets.VAULT_APPROLE_SECRET_ID }}
72-
CHARMHUB_TOKEN: ${{ secrets.CHARMHUB_TOKEN }}
84+
CHARMHUB_TOKEN: ${{ secrets.CHARMHUB_TOKEN }}

0 commit comments

Comments
 (0)