Use GitHub API for lock file timestamp checks instead of repository checkout#4142
Merged
Use GitHub API for lock file timestamp checks instead of repository checkout#4142
Conversation
- Remove checkout step from activation job - Create new check_workflow_timestamp_api.cjs that uses GitHub API - Update compiler to use API-based script instead of filesystem access - Update permissions comment to reflect API access instead of checkout - Update tests to verify checkout is removed and API is used - All 80 workflows now use GitHub API for timestamp checks Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
The old filesystem-based script is no longer used after switching to GitHub API. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…heckout Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update activation job to check lock file status
Use GitHub API for lock file timestamp checks instead of repository checkout
Nov 16, 2025
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the workflow timestamp checking mechanism by replacing filesystem-based checks (which required a repository checkout) with GitHub API calls. The activation job now uses github.rest.repos.listCommits to fetch the last commit timestamps for both the source .md file and compiled .lock.yml file, comparing commit dates instead of filesystem modification times.
Key Changes:
- Created API-based timestamp checking script (
check_workflow_timestamp_api.cjs) - Removed checkout step from activation job generation
- Updated tests to verify absence of checkout and presence of API calls
- Regenerated all 80+ workflow lock files with the new approach
Reviewed Changes
Copilot reviewed 87 out of 87 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/js/check_workflow_timestamp_api.cjs |
New JavaScript implementation using GitHub API for timestamp checks with commit SHA links |
pkg/workflow/js.go |
Updated embedded script reference from checkWorkflowTimestampScript to checkWorkflowTimestampAPIScript |
pkg/workflow/compiler_jobs.go |
Removed checkout step generation and updated comments to reflect API-based approach |
pkg/workflow/activation_checkout_test.go |
Renamed test and updated assertions to verify no checkout and API usage |
pkg/workflow/task_and_reaction_permissions_test.go |
Updated test assertions to validate GitHub API calls instead of checkout |
.github/workflows/*.lock.yml |
All 80 workflow lock files regenerated with new API-based timestamp check |
docs/src/content/docs/status.mdx |
Updated workflow status table (unrelated workflow name changes) |
docs/src/content/docs/reference/frontmatter-full.md |
Documentation updates (unrelated timeout default and field descriptions) |
.changeset/patch-api-timestamp-checks.md |
Changeset file documenting the patch |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The activation job previously checked out the repository to compare file modification times between workflow source (
.md) and compiled lock file (.lock.yml). This required a checkout step with sparse-checkout configuration.Changes
New JavaScript implementation
check_workflow_timestamp_api.cjsusinggithub.rest.repos.listCommitsto fetch last commit for each fileCompiler updates
buildActivationJob()contents: readpermission now used for API access (previously for checkout)Test updates
activation_checkout_test.goto verify checkout absence and API usagetask_and_reaction_permissions_test.goto validate GitHub API callsExample output
Before:
After:
All 80 workflows updated to use GitHub API approach.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.