Skip to content

Commit 703fd82

Browse files
authored
ci(workflows): use org reusable issue and preview checks (#4996)
* ci(workflows): use org reusable issue and preview checks Replace custom issue labeling with the org reusable workflow and gate Surge preview deploys behind the org team-membership reusable check. Made-with: Cursor * ci(workflows): use ci:build:doc-core for astro preview build
1 parent 9091ff1 commit 703fd82

4 files changed

Lines changed: 38 additions & 47 deletions

File tree

.github/workflows-src/pr-preview.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
name: pr-preview
2-
on: pull_request_target
2+
on:
3+
pull_request_target:
4+
issue_comment:
5+
types: [created]
36
jobs:
7+
check-permissions:
8+
uses: patternfly/.github/.github/workflows/check-team-membership.yml@main
9+
secrets: inherit
10+
411
build-upload:
512
runs-on: ubuntu-latest
13+
needs: check-permissions
14+
if: needs.check-permissions.outputs.allowed == 'true'
615
env:
716
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
817
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
918
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
10-
GH_PR_NUM: ${{ github.event.number }}
19+
GH_PR_NUM: ${{ needs.check-permissions.outputs.pr-number }}
1120
steps:
1221
- uses: actions/checkout@v4
1322
# Yes, we really want to checkout the PR
@@ -20,11 +29,13 @@ jobs:
2029
name: Upload docs
2130
build-upload-astro:
2231
runs-on: ubuntu-latest
32+
needs: check-permissions
33+
if: needs.check-permissions.outputs.allowed == 'true'
2334
env:
2435
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
2536
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
2637
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
27-
GH_PR_NUM: ${{ github.event.number }}
38+
GH_PR_NUM: ${{ needs.check-permissions.outputs.pr-number }}
2839
steps:
2940
- uses: actions/checkout@v4
3041
- run: |

.github/workflows/add-new-issues-to-project.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Label PF Team issues
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
jobs:
7+
label:
8+
uses: patternfly/.github/.github/workflows/add-pf-team-label-workflow.yml@main
9+
secrets: inherit

.github/workflows/pr-preview.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
### WARNING -- this file was generated by generate-workflows.js
22
name: pr-preview
3-
on: pull_request_target
3+
on:
4+
pull_request_target:
5+
issue_comment:
6+
types: [created]
47
jobs:
8+
check-permissions:
9+
uses: patternfly/.github/.github/workflows/check-team-membership.yml@main
10+
secrets: inherit
11+
512
build-upload:
613
runs-on: ubuntu-latest
14+
needs: check-permissions
15+
if: needs.check-permissions.outputs.allowed == 'true'
716
env:
817
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
918
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
1019
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
11-
GH_PR_NUM: ${{ github.event.number }}
20+
GH_PR_NUM: ${{ needs.check-permissions.outputs.pr-number }}
1221
steps:
1322
- uses: actions/checkout@v4
1423
# Yes, we really want to checkout the PR
@@ -33,11 +42,13 @@ jobs:
3342
name: Upload docs
3443
build-upload-astro:
3544
runs-on: ubuntu-latest
45+
needs: check-permissions
46+
if: needs.check-permissions.outputs.allowed == 'true'
3647
env:
3748
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
3849
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
3950
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
40-
GH_PR_NUM: ${{ github.event.number }}
51+
GH_PR_NUM: ${{ needs.check-permissions.outputs.pr-number }}
4152
steps:
4253
- uses: actions/checkout@v4
4354
- run: |
@@ -55,5 +66,5 @@ jobs:
5566
with:
5667
path: "packages/documentation-site/.cache"
5768
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
58-
- run: yarn build:doc-core
69+
- run: yarn ci:build:doc-core
5970
name: Build astro docs

0 commit comments

Comments
 (0)