-
-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (79 loc) · 3.7 KB
/
Copy pathcompile-agentic-workflows.yml
File metadata and controls
91 lines (79 loc) · 3.7 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
85
86
87
88
89
90
91
name: Compile Agentic Workflows
# Compile .md workflow files to .lock.yml and commit all generated artifacts.
# News workflows import modules from .github/prompts/ (see that dir's README).
on:
workflow_dispatch:
# Serialize manual compile runs so two clicks of "Run workflow" cannot race the
# final `git push` to the default branch and produce a conflicting commit.
# cancel-in-progress: false — never cancel a run that may have already pushed
# partial state; let it finish and the next run will recompile cleanly.
concurrency:
group: compile-agentic-workflows
cancel-in-progress: false # never cancel; in-flight run may have pushed partial state
permissions:
contents: write
jobs:
compile:
name: Compile Agentic Workflows
runs-on: ubuntu-26.04
timeout-minutes: 30
steps:
- name: Harden Runner
uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
# Required true: the final "Commit all generated files" step needs the
# token persisted in git config to push the recompiled lock files back
# to the default branch.
persist-credentials: true
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '26'
cache: 'npm'
cache-dependency-path: |
package-lock.json
.github/workflows/compile-agentic-workflows.yml
- name: Install gh-aw CLI
run: |
GH_AW_VERSION="v0.83.1"
gh extension install github/gh-aw --pin "$GH_AW_VERSION"
env:
GH_TOKEN: ${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
- name: Lint prompt sources
# Source-of-truth correctness lives in the original workflow/prompt
# Markdown — never in the generated lock files. This runs the same
# linter that CI exercises (scripts/lint-prompts.js: single-PR rule,
# banned heartbeat/keep-alive phrases, analysis-awareness, canonical
# import order) so a source error fails fast before compilation.
run: node scripts/lint-prompts.js
- name: Compile all workflows
# --validate runs the JSON-schema + actionlint checks at compile time
# so a schema error (e.g. missing concurrency.group) fails fast here
# instead of producing a broken lock file that only the scheduled
# validate-agentic-workflows job catches hours later.
# --purge removes any orphaned .lock.yml whose source .md was deleted,
# replacing the old "delete every lock then recompile" workaround.
# The generated lock files are committed verbatim — this workflow does
# NOT post-process them.
run: gh aw compile --validate --purge
env:
GH_TOKEN: ${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
- name: Commit all generated files
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .github/workflows/*.lock.yml \
.github/workflows/agentics-maintenance.yml \
.github/aw/actions-lock.json
if git diff --cached --quiet; then
echo "No changes to commit"
else
git diff --cached --stat
git commit -m "chore: recompile agentic workflow lock files"
git push
fi