Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

The check_workflow_timestamp_api.cjs script detects when a workflow .md source file is newer than its compiled .lock.yml file, but was only logging an error annotation without failing the step. This allowed workflows to execute with stale configurations.

Changes

  • Replace core.error() with core.setFailed() in timestamp check
  • Add test coverage for API-based timestamp validation (12 test cases)

Example

When a workflow source is modified after its lock file:

// Before: logged error but step succeeded
core.error(warningMessage);

// After: step fails, blocking workflow execution
core.setFailed(warningMessage);

The activation job now properly fails with:

Lock file 'daily-fact.lock.yml' is outdated! The workflow file 'daily-fact.md' 
has been modified more recently. Run 'gh aw compile' to regenerate the lock file.

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:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login runs/20251231-194528-10342/test-2758341824/.githremote.origin.url --jq /bin/sh g_.a (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login e-github-app-token.git e-github-app-token.git /usr/bin/git l main -lang=go1.25 git -C k/gh-aw/gh-aw/.github/workflows config e/git-remote-https l -c=4 -nolocalimports e/git-remote-https (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tags/v6 -test.v=true 96c3ed8687754408aeaae6746a775d98956/log.json -test.run=^Test (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20617658329/job/59213445486

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Change from core.error() to core.setFailed() when lock file is outdated
- This ensures the activation job fails instead of continuing with outdated config
- Add comprehensive test coverage for the API-based timestamp check
- All tests pass (122 test files, 2525 tests)

The script now properly fails the step when it detects that a workflow .md file
has been modified more recently than its compiled .lock.yml file, preventing
workflows from running with outdated configurations.

Fixes: https://github.com/githubnext/gh-aw/actions/runs/20617658329/job/59213445486

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Actions workflow for better efficiency Fix workflow timestamp check to fail on outdated lock files Dec 31, 2025
Copilot AI requested a review from pelikhan December 31, 2025 19:53
@pelikhan pelikhan marked this pull request as ready for review December 31, 2025 19:55
@pelikhan pelikhan merged commit af53cac into main Dec 31, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/update-gh-aw-workflow branch December 31, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants