Skip to content

Commit 783dc83

Browse files
chadlwilsonCopilot
andauthored
ci: automatically publish suppressions after merged PRs (#8527)
Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f2c940f commit 783dc83

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/lint-pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: "Lint PR"
22

33
on:
44
pull_request_target:
5+
# BE CAREFUL - this event runs in the context of the default branch (`main`) workflow definition in the target
6+
# repository (NOT the fork's context), so it has potentially sensitive access.
7+
# It is critical that this only runs on very limited events and/or access to the repo
8+
# Read https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
59
types:
610
- opened
711
- edited

.github/workflows/publish-suppressions.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ name: Publish Suppressions
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- generatedSuppressions
5+
pull_request_target:
6+
# BE CAREFUL - this event runs in the context of the default branch (`main`) workflow definition in the target
7+
# repository (NOT the fork's context), so it has potentially sensitive access.
8+
# It is critical that this only runs on very limited events and/or access to the repo
9+
# Read https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
10+
types: [ closed ]
11+
branches: [ generatedSuppressions ]
12+
paths: [ generatedSuppressions.xml ]
13+
814

915
permissions: {}
1016
jobs:
1117
update_suppression:
18+
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
19+
1220
permissions:
1321
contents: write # to push changes in repo (jamesives/github-pages-deploy-action)
1422

0 commit comments

Comments
 (0)