Skip to content

Commit 0ceff01

Browse files
feat: introduce checks in PRs (#17)
1 parent cbc4e7a commit 0ceff01

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/actions-allow-list.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
paths:
77
- github-actions-allow-list.yml
88
- .github/workflows/actions-allow-list.yml
9+
pull_request:
10+
branches: [ main ]
911
workflow_dispatch:
1012

1113
jobs:
12-
deploy:
14+
run:
1315
runs-on: ubuntu-latest
1416

1517
permissions: read-all
@@ -25,9 +27,19 @@ jobs:
2527
private-key: ${{ secrets.PRIVATE_KEY }}
2628
owner: ${{ github.repository_owner }}
2729

30+
- name: validate yml
31+
run: |
32+
if yq eval github-actions-allow-list.yml; then
33+
echo "Actions YML is valid"
34+
else
35+
echo "Actions YML validation failed"
36+
exit 1
37+
fi
38+
2839
# if using Enterprise, use the `/enterprises/<enterprise-slug>` endpoint
2940
# and PAT - can't use GitHub app at Enterprise at Enterprise level
3041
- name: Enable Actions Policy in Org
42+
if: github.event_name != 'pull_request'
3143
env:
3244
GH_TOKEN: ${{ steps.app-token.outputs.token }}
3345
run: |
@@ -40,6 +52,7 @@ jobs:
4052
-F verified_allowed=true
4153
4254
- name: Deploy GitHub Actions allow list
55+
if: github.event_name != 'pull_request'
4356
uses: ActionsDesk/[email protected]
4457
with:
4558
token: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)