Skip to content

Commit 2965622

Browse files
authored
Fix Workflow Security Issue (#252)
* Delete .github/workflows/dependabot-labels.yml * Update changie-gen.yaml
1 parent 306551c commit 2965622

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

.github/workflows/changie-gen.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: Changie Gen
22

33
on:
4-
workflow_run:
5-
workflows: [Dependabot Labels]
6-
types:
7-
- completed
4+
pull_request:
5+
# catch when the PR is opened with the label or when the label is added
6+
types: [labeled]
7+
8+
permissions:
9+
contents: write
10+
pull-requests: read
811

912
jobs:
1013
generate-changelog:
14+
if: contains(github.event.pull_request.labels.*.name, 'dependencies')
1115
env:
1216
MAIN_BRANCH: ${{ github.event.workflow_run.pull_requests[0].base.ref }}
1317
PR_BRANCH: ${{ github.event.workflow_run.pull_requests[0].head.ref }}
@@ -19,7 +23,7 @@ jobs:
1923
uses: actions/checkout@v4
2024
with:
2125
ref: ${{ env.PR_BRANCH }}
22-
token: ${{ secrets.ORG_GITHUB_TOKEN }}
26+
token: ${{ secrets.GITHUB_TOKEN }}
2327

2428
- name: Check if changelog file exists already
2529
if: github.event.workflow_run.conclusion == 'success'

.github/workflows/dependabot-labels.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)