Skip to content

Commit d4e1da4

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

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

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

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
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
13-
14-
permissions:
15-
contents: read
16-
pull-requests: read
4+
workflow_call:
5+
inputs:
6+
pr_number:
7+
required: true
8+
type: number
9+
secrets:
10+
token:
11+
required: true
1712

1813
jobs:
1914
major-version-approval-check:
2015
name: Major Version Approval Check
2116
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=')
2517
steps:
2618
- uses: actions/checkout@v5
2719
- name: Check for at least 2 approvals from yoshi-php members
2820
env:
29-
GH_TOKEN: ${{ secrets.SPLIT_TOKEN }}
30-
PR_NUMBER: ${{ github.event.pull_request.number }}
21+
GH_TOKEN: ${{ secrets.token }}
22+
PR_NUMBER: ${{ inputs.pr_number }}
3123
REQUIRED_APPROVALS: 2
3224
run: |
3325
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)