Skip to content

Commit 65a93fa

Browse files
authored
Merge pull request #236 from Gnathonic/fix/pr-target-guard-permissions
fix(ci): grant PR-guard write perms, run CI on develop
2 parents 8313e35 + d31eadf commit 65a93fa

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [main]
7+
branches: [main, develop]
88

99
jobs:
1010
lint:
@@ -98,7 +98,8 @@ jobs:
9898
release-check:
9999
name: Release Check
100100
runs-on: ubuntu-latest
101-
if: github.event_name == 'pull_request'
101+
# Only relevant for release PRs (develop -> main); skip on PRs into develop.
102+
if: github.event_name == 'pull_request' && github.base_ref == 'main'
102103
steps:
103104
- uses: actions/checkout@v4
104105
with:

.github/workflows/pr-target-guard.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ on:
44
pull_request_target:
55
types: [opened, reopened, synchronize]
66

7+
permissions:
8+
pull-requests: write
9+
contents: read
10+
711
jobs:
8-
# Block any PR to main that doesn't come from develop
12+
# Block any PR to main that doesn't come from develop (non-fork branches only;
13+
# forks are handled by redirect-forks below to avoid a duplicate message).
914
require-develop-to-main:
1015
runs-on: ubuntu-latest
11-
if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref != 'develop'
16+
if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref != 'develop' && !github.event.pull_request.head.repo.fork
1217
steps:
1318
- name: Block non-develop PRs to main
1419
run: |

0 commit comments

Comments
 (0)