Skip to content

Commit ea04dbc

Browse files
authored
ci: allow PRs to run from external contributions (#113)
1 parent ee8ad6e commit ea04dbc

3 files changed

Lines changed: 1298 additions & 881 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
concurrency:
10+
group: ci-${{ github.head_ref || github.ref }}
11+
cancel-in-progress: true
412

513
env:
614
CARGO_TERM_COLOR: always
715

816
jobs:
917
lint:
10-
# Avoid duplicate jobs on PR from a branch on the same repo
11-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1218
runs-on: ubuntu-latest
1319
steps:
1420
- uses: actions/checkout@v3
@@ -34,8 +40,6 @@ jobs:
3440
env:
3541
RUSTDOCFLAGS: -Dwarnings
3642
test:
37-
# Avoid duplicate jobs on PR from a branch on the same repo
38-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
3943
runs-on: ubuntu-latest
4044
steps:
4145
- uses: actions/checkout@v3
@@ -49,7 +53,7 @@ jobs:
4953
# https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
5054
# https://stackoverflow.com/questions/58858429/how-to-run-a-github-actions-step-even-if-the-previous-step-fails-while-still-f
5155

52-
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
56+
if: always()
5357
runs-on: ubuntu-latest
5458
needs:
5559
- lint

0 commit comments

Comments
 (0)