Skip to content

Commit

Permalink
chore(ci): lockdown workflow_run by origin (aws-powertools#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorlessa authored Jul 22, 2022
1 parent 005e093 commit ce44892
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 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 @@ -14,6 +14,7 @@ jobs:
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
label_pr:
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 @@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
release_label_on_merge:
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 @@ -12,6 +12,7 @@ jobs:
uses: ./.github/workflows/reusable_export_pr_details.yml
with:
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
workflow_origin: ${{ github.event.repository.full_name }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
check_related_issue:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/reusable_export_pr_details.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
record_pr_workflow_id:
required: true
type: number
workflow_origin: # see https://github.com/awslabs/aws-lambda-powertools-python/issues/1349
required: true
type: string
secrets:
token:
required: true
Expand All @@ -32,6 +35,8 @@ on:

jobs:
export_pr_details:
# see https://github.com/awslabs/aws-lambda-powertools-python/issues/1349
if: inputs.workflow_origin == 'awslabs/aws-lambda-powertools-python'
runs-on: ubuntu-latest
env:
FILENAME: pr.txt
Expand Down

0 comments on commit ce44892

Please sign in to comment.