Skip to content

Commit 66c6091

Browse files
authored
fix: separate safe permission check job and ci job (#5460)
1 parent b917b66 commit 66c6091

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

.github/workflows/pr-example.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
name: Example Workflow
22

33
on:
4-
workflow_run:
5-
workflows: ["PR Permission Gate"]
6-
types:
7-
- completed
4+
pull_request:
5+
branches:
6+
- main
87

98
permissions:
109
contents: read
1110

11+
concurrency:
12+
group: pr-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
1215
jobs:
1316
pre-commit:
14-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1517
runs-on: ubuntu-latest
1618
steps:
1719
- uses: actions/checkout@v5

.github/workflows/pr-gate.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
- name: Checkout base branch (safe)
2121
uses: actions/checkout@v5
2222
with:
23-
# checkout the workflow's commit (base branch), not the PR head
2423
ref: ${{ github.event.pull_request.base.sha }}
2524
fetch-depth: 1
26-
2725
- name: Run permission gate (from base)
2826
uses: ./.github/actions/pr-permission-gate

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ default_stages:
88

99
repos:
1010
- repo: https://github.com/reteps/dockerfmt
11-
# run `pre-commit autoupdate` to pin the version
12-
rev: main
11+
rev: v0.3.9
1312
hooks:
1413
- id: dockerfmt
1514
args:

0 commit comments

Comments
 (0)