Move permissions from workflow level to job level

This commit is contained in:
Aditya Telange
2026-03-08 22:50:54 +05:30
parent a2f09c8c0d
commit 10d3dcc0e0
+5 -6
View File
@@ -27,15 +27,11 @@ defaults:
run: run:
shell: bash shell: bash
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs: jobs:
# Build job # Build job
build: build:
permissions:
contents: read
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.146.0' }} HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.146.0' }}
@@ -66,6 +62,9 @@ jobs:
path: ./public path: ./public
# Deployment job # Deployment job
deploy: deploy:
permissions:
pages: write
id-token: write
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}