Skip to content

Commit

Permalink
ci: granular token permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Jun 7, 2023
1 parent 202599b commit 06fa38b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ name: push
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}

permissions: read-all

jobs:
metadata:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -79,6 +81,10 @@ jobs:

runs-on: ubuntu-latest

permissions:
contents: write
packages: write

outputs:
published: ${{ steps.release.outputs.published }}
version: ${{ steps.release.outputs.release-version }}
Expand Down Expand Up @@ -110,6 +116,10 @@ jobs:

runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/[email protected]
- uses: docker/setup-qemu-action@v2
Expand All @@ -120,7 +130,7 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}

# publish
- uses: docker/build-push-action@v3
Expand All @@ -147,6 +157,10 @@ jobs:

runs-on: ubuntu-latest

permissions:
contents: write
packages: write

strategy:
matrix:
release: [ "v${{ needs.release.outputs.version }}" ]
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ inputs:

runs:
using: docker
image: docker://ghcr.io/ahmadnassri/action-workflow-queue:v1
image: docker://ghcr.io/ahmadnassri/action-workflow-queue:1.0.0

0 comments on commit 06fa38b

Please sign in to comment.