1
0
Fork 0
mirror of https://github.com/imjasonh/git-k8s synced 2026-07-12 08:28:38 +00:00
git-k8s/.github/workflows/compile-workflows.yaml
copilot-swe-agent[bot] d795654f97 Address code review comments on compile-workflows.yaml and code-review.md
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
2026-02-28 17:42:30 +00:00

57 lines
1.8 KiB
YAML

name: Compile Agentic Workflows
on:
pull_request:
branches: ["main"]
paths:
- ".github/workflows/*.md"
push:
branches: ["main"]
paths:
- ".github/workflows/*.md"
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
# Skip fork PRs: secrets are unavailable, and we should not compile
# untrusted .md content from a fork and push it back.
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
permissions:
contents: read # checkout; push uses GH_PAT explicitly
steps:
- name: Checkout (push)
if: github.event_name == 'push'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ secrets.GH_PAT }}
- name: Checkout (PR head branch)
if: github.event_name == 'pull_request'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GH_PAT }}
- name: Install gh-aw extension
run: gh extension install github/gh-aw --version v0.50.7
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
- name: Compile all agentic workflows
run: gh aw compile .github/workflows/*.md
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
- name: Commit and push lock files if changed
run: |
git add .github/workflows/*.lock.yml || true
if git diff --cached --quiet; then
echo "Lock files are up to date."
else
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Recompile agentic workflow lock files"
git push
fi