Repository navigation
84 lines (76 loc) · 2.47 KB
/
Copy pathopenspec-progress-phase.yml
File metadata and controls
84 lines (76 loc) · 2.47 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: OpenSpec Progress Phase
on:
pull_request:
types:
- opened
- reopened
- synchronize
pull_request_target:
types:
- closed
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to progress"
required: false
next_state:
description: "Next OpenSpec label state"
required: false
dry_run:
description: "Perform a dry run"
required: false
default: "true"
permissions:
issues: write
pull-requests: write
contents: read
jobs:
progress-phase:
runs-on: ubuntu-latest
name: Progress Phase on PR Event
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Handle PR opened
if: github.event.action == 'opened' || github.event.action == 'reopened'
run: |
node scripts/automation/handlers/handle-pr-opened.cjs \
--pr=${{ github.event.pull_request.number }} \
--dry-run=${{ github.event.inputs.dry_run || 'false' }} \
--verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}
- name: Handle PR merged
if: github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
node scripts/automation/handlers/handle-pr-merged.cjs \
--pr=${{ github.event.pull_request.number }} \
--dry-run=${{ github.event.inputs.dry_run || 'false' }} \
--verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BODY: ${{ github.event.pull_request.body }}
- name: Handle manual progression
if: github.event_name == 'workflow_dispatch'
run: |
node scripts/automation/handlers/handle-issue-labeled.cjs \
--issue=${{ github.event.inputs.issue_number }} \
--label=${{ github.event.inputs.next_state }} \
--dry-run=${{ github.event.inputs.dry_run }} \
--verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log progression results
if: always()
run: |
echo "Phase progression completed"
echo "PR: ${{ github.event.pull_request.number }}"
echo "Event: ${{ github.event.action }}"