Skip to content

Commit 7e6715a

Browse files
committed
chore: separate logic and workflow into separate files in attempt to resolve duplicate job issue
1 parent bd00589 commit 7e6715a

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

.github/workflows/major-version-approval.yaml renamed to .github/workflows/major-version-approval-logic.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
name: Major Version Approval Check
1+
name: Major Version Approval Logic
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review, edited]
6-
branches: ['main']
7-
pull_request_review:
8-
types: [submitted, dismissed]
9-
10-
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12-
cancel-in-progress: true
4+
workflow_call:
5+
inputs:
6+
pr_number:
7+
required: true
8+
type: number
9+
secrets:
10+
token:
11+
required: true
1312

1413
permissions:
1514
contents: read
@@ -19,15 +18,12 @@ jobs:
1918
major-version-approval-check:
2019
name: Major Version Approval Check
2120
runs-on: ubuntu-latest
22-
if: contains(github.event.pull_request.body, 'MAJOR_VERSION_ALLOWED=')
23-
# testing
24-
# if: github.event.pull_request.user.login == 'release-please[bot]' && contains(github.event.pull_request.body, 'MAJOR_VERSION_ALLOWED=')
2521
steps:
2622
- uses: actions/checkout@v5
2723
- name: Check for at least 2 approvals from yoshi-php members
2824
env:
29-
GH_TOKEN: ${{ secrets.SPLIT_TOKEN }}
30-
PR_NUMBER: ${{ github.event.pull_request.number }}
25+
GH_TOKEN: ${{ secrets.token }}
26+
PR_NUMBER: ${{ inputs.pr_number }}
3127
REQUIRED_APPROVALS: 2
3228
run: |
3329
set -e
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Major Version Approval Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review, edited]
6+
branches: ['main']
7+
pull_request_review:
8+
types: [submitted, dismissed]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
pull-requests: read
17+
18+
jobs:
19+
call-approval-check:
20+
if: contains(github.event.pull_request.body, 'MAJOR_VERSION_ALLOWED=')
21+
uses: ./.github/workflows/major-version-approval-logic.yaml
22+
with:
23+
pr_number: ${{ github.event.pull_request.number }}
24+
secrets:
25+
token: ${{ secrets.SPLIT_TOKEN }}

0 commit comments

Comments
 (0)