Skip to content

Commit 84d75be

Browse files
authored
Updated PR-audit flow with label (#41)
1 parent 701b3ab commit 84d75be

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/security-scan.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ main, master ]
66
pull_request_target:
7-
types: [ opened, synchronize ]
7+
types: [ labeled ]
88
schedule:
99
- cron: '0 9 * * 1' # Weekly on Monday at 9 AM UTC
1010

@@ -15,6 +15,7 @@ permissions:
1515

1616
jobs:
1717
jfrog-audit:
18+
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'safe to test')
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Checkout code
@@ -41,3 +42,15 @@ jobs:
4142
- name: Run Tests
4243
run: mvn clean test -B
4344

45+
- name: Remove label
46+
if: always() && github.event_name == 'pull_request_target'
47+
uses: actions/github-script@v7
48+
with:
49+
script: |
50+
github.rest.issues.removeLabel({
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
issue_number: context.issue.number,
54+
name: 'safe to test'
55+
})
56+

0 commit comments

Comments
 (0)