Skip to content

Commit b27315a

Browse files
Copilotpelikhan
andauthored
Add automated workflow update action (#1)
* Initial plan * Add update-workflows GitHub Action - Installs gh-aw extension using official installation script - Runs gh aw update to update workflow definitions - Runs gh aw compile to compile workflows - Automatically commits and pushes any changes - Scheduled to run weekly on Sundays - Can be manually triggered via workflow_dispatch Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Address review feedback - Remove gh CLI installation step (always installed on runners) - Replace 'gh aw update' with 'gh aw init' - Update commit message to reflect gh aw init Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Randomize cron schedule minute - Changed from "0 0 * * 0" to "23 0 * * 0" - Runs at 00:23 UTC instead of 00:00 UTC to avoid load spikes Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 0336630 commit b27315a

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: "Update Agentic Workflows"
2+
3+
# This workflow automatically updates and compiles agentic workflows
4+
on:
5+
schedule:
6+
- cron: "23 0 * * 0" # Run weekly on Sunday at 00:23 UTC
7+
workflow_dispatch: # Allow manual trigger
8+
push:
9+
paths:
10+
- .github/workflows/update-workflows.yml
11+
12+
jobs:
13+
update-workflows:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: write # Need write permission to commit changes
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Install gh-aw extension
26+
run: |
27+
curl -fsSL https://raw.githubusercontent.com/githubnext/gh-aw/refs/heads/main/install-gh-aw.sh | bash
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Verify gh-aw installation
32+
run: gh aw version
33+
34+
- name: Run gh aw init
35+
run: gh aw init
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Run gh aw compile
40+
run: gh aw compile
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Check for changes
45+
id: check_changes
46+
run: |
47+
if [[ -n $(git status --porcelain) ]]; then
48+
echo "changes=true" >> $GITHUB_OUTPUT
49+
echo "Changes detected:"
50+
git status --short
51+
else
52+
echo "changes=false" >> $GITHUB_OUTPUT
53+
echo "No changes detected"
54+
fi
55+
56+
- name: Commit and push changes
57+
if: steps.check_changes.outputs.changes == 'true'
58+
run: |
59+
git config user.name "github-actions[bot]"
60+
git config user.email "github-actions[bot]@users.noreply.github.com"
61+
git add .
62+
git commit -m "chore: update agentic workflows
63+
64+
- Ran gh aw init
65+
- Ran gh aw compile
66+
- Auto-generated by update-workflows action"
67+
git push
68+
env:
69+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Summary
72+
run: |
73+
echo "## Workflow Update Summary" >> $GITHUB_STEP_SUMMARY
74+
echo "" >> $GITHUB_STEP_SUMMARY
75+
if [[ "${{ steps.check_changes.outputs.changes }}" == "true" ]]; then
76+
echo "✅ Changes were detected and committed" >> $GITHUB_STEP_SUMMARY
77+
else
78+
echo "ℹ️ No changes were detected" >> $GITHUB_STEP_SUMMARY
79+
fi

0 commit comments

Comments
 (0)