Skip to content

Commit

Permalink
chore(ci): propagate checkout permission to nested workflows (#2642)
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorlessa authored Jul 4, 2023
1 parent cdd28fe commit c246e66
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/label_pr_on_title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
get_pr_details:
permissions:
actions: read # download PR artifact
contents: read # checkout code
# Guardrails to only ever run if PR recording workflow was indeed
# run in a PR event and ran successfully
if: ${{ github.event.workflow_run.conclusion == 'success' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on_label_added.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
get_pr_details:
permissions:
actions: read # download PR artifact
contents: read # checkout code
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on_merged_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
get_pr_details:
permissions:
actions: read # download PR artifact
contents: read # checkout code
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on_opened_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
get_pr_details:
permissions:
actions: read # download PR artifact
contents: read # checkout code
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_pr_updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: PR requirements
# due to limitations in GH API.

on:
pull_request:
pull_request:
types:
- opened
- labeled
Expand All @@ -26,7 +26,7 @@ on:
permissions: {} # no permission required

jobs:
fail-for-draft:
check-requirements:
runs-on: ubuntu-latest
steps:
- name: Block if it doesn't minimum requirements
Expand Down

0 comments on commit c246e66

Please sign in to comment.