Skip to content

Commit 879fcbe

Browse files
committed
chore(ci): experiment hardening origin
1 parent 2de2bac commit 879fcbe

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.github/workflows/label_pr_on_title.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
uses: ./.github/workflows/reusable_export_pr_details.yml
1515
with:
1616
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
17+
workflow_origin: ${{ github.event.repository.full_name }}
1718
secrets:
1819
token: ${{ secrets.GITHUB_TOKEN }}
1920
label_pr:

.github/workflows/on_merged_pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
uses: ./.github/workflows/reusable_export_pr_details.yml
1313
with:
1414
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
15+
workflow_origin: ${{ github.event.repository.full_name }}
1516
secrets:
1617
token: ${{ secrets.GITHUB_TOKEN }}
1718
release_label_on_merge:

.github/workflows/on_opened_pr.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ jobs:
1010
get_pr_details:
1111
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1212
uses: ./.github/workflows/reusable_export_pr_details.yml
13+
env:
1314
with:
1415
record_pr_workflow_id: ${{ github.event.workflow_run.id }}
16+
workflow_origin: ${{ github.event.repository.full_name }}
1517
secrets:
1618
token: ${{ secrets.GITHUB_TOKEN }}
1719
check_related_issue:

.github/workflows/reusable_export_pr_details.yml

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
record_pr_workflow_id:
77
required: true
88
type: number
9+
# this protects from anyone mimicking "Record PR details" dependency
10+
# regardless of our untrusted input validation
11+
workflow_origin:
12+
required: true
13+
type: string
914
secrets:
1015
token:
1116
required: true
@@ -32,6 +37,7 @@ on:
3237

3338
jobs:
3439
export_pr_details:
40+
if: inputs.workflow_origin == "bla/bla"
3541
runs-on: ubuntu-latest
3642
env:
3743
FILENAME: pr.txt

0 commit comments

Comments
 (0)