-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (52 loc) · 1.5 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
name: Pull Request or Push
on:
push:
branches:
- 'main' # Run on pushes to main
tags-ignore:
- '*' # Ignore pushes to tags
pull_request:
jobs:
# After merging the release PR, we don't want to trigger
# this workflow in addition to the Tagged Releases one.
# This pauses CI on pushes to the main branch completely.
check_release_in_progress:
name: Skip CI While Releasing
runs-on: ubuntu-24.04
if: github.event_name == 'push'
outputs:
count: ${{ steps.workflow_count.outputs.count }}
steps:
- name: Count Running Release Workflows Triggered by Automated PR
id: workflow_count
env:
GH_TOKEN: ${{ github.token }}
run: |
count="$(gh run list \
--repo "$GITHUB_REPOSITORY" \
--event pull_request \
--branch release/auto \
--workflow 'Tagged Releases' \
--json status \
--jq 'map(select(.status == ("queued","in_progress"))) | length')"
echo "count=$count" >> "$GITHUB_OUTPUT"
call_central_workflow:
name: CI
needs:
- check_release_in_progress
if: >
always() &&
github.event_name != 'push' ||
(
needs.check_release_in_progress.result == 'success' &&
needs.check_release_in_progress.outputs.count == '0'
)
uses: ./.github/workflows/ci.yml
with:
deploy-docs: true
permissions:
contents: write
id-token: write
pages: write
pull-requests: write