ci: add copilot sessionEnd hook to auto-approve pending CI workflow runs#1011
ci: add copilot sessionEnd hook to auto-approve pending CI workflow runs#1011levalleux-ludo merged 17 commits intomainfrom
Conversation
|
|
Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
|
@copilot the title of the commit and of the PR are not compliant with the rules (see ./.github/copilot-instructions.md). |
Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
Added commit The PR title also needs to be renamed to match the same format ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Copilot “session end” hook configuration intended to automatically approve GitHub Actions workflow runs that are pending manual approval after Copilot pushes commits.
Changes:
- Introduces a
session_end.shhook script that queries workflow runs for the current branch and attempts to approve pending runs. - Adds
.github/hooks/hooks.jsonto register thesessionEndhook and run the script with a 60s timeout.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/hooks/session_end.sh | New hook script that finds and approves action-required workflow runs for the current git branch. |
| .github/hooks/hooks.json | Registers the sessionEnd hook to execute the new bash script. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1011 +/- ##
=======================================
Coverage 90.95% 90.95%
=======================================
Files 179 179
Lines 7288 7288
Branches 1366 1366
=======================================
Hits 6629 6629
Misses 659 659
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…y checks Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
The |
Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
…workflow-workaround
…un IDs Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
The PR title "ci: add copilot sessionEnd hook to auto-approve pending CI workflow runs" and all recent commit titles follow the Conventional Commits format defined in |
Co-authored-by: levalleux-ludo <7184124+levalleux-ludo@users.noreply.github.com>
.github/hooks/hooks.jsondefining thesessionEndhook.github/hooks/session_end.shscript that approves pending CI workflow runs when a Copilot session endssleep 10+ single query with a bounded polling loop (every 10s for up to 120s) to handle queue delays and API lag.github/directory (fail-closed: skips if diff fails)copilot[bot])DEFAULT_BRANCHin protected branches listcopilot/onlygh run liststdout and stderr separately (temp file) so warnings don't appear as run IDs; validate each run ID is numeric before attempting approvalOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.