-
Notifications
You must be signed in to change notification settings - Fork 8
Add workflow to update bundle and licenses #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,106 @@ | ||||||||||
| name: Auto-fix CI failures | ||||||||||
|
|
||||||||||
| on: | ||||||||||
| workflow_run: | ||||||||||
| workflows: | ||||||||||
| - Continuous Integration | ||||||||||
| types: | ||||||||||
| - completed | ||||||||||
|
|
||||||||||
| permissions: | ||||||||||
| contents: write | ||||||||||
| pull-requests: write | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| auto-fix: | ||||||||||
| name: Refresh licensed cache and bundle | ||||||||||
| if: >- | ||||||||||
| github.event.workflow_run.event == 'pull_request' && | ||||||||||
| github.event.workflow_run.conclusion == 'failure' | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| env: | ||||||||||
| PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} | ||||||||||
|
||||||||||
| PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Ruby version is hardcoded to '3.3', but the existing licensed.yml workflow uses 'ruby' which automatically detects the version from .ruby-version or .tool-versions files. Consider using 'ruby' for consistency with the existing workflow, or ensure both workflows use the same explicit version.
| ruby-version: '3.3' | |
| ruby-version: 'ruby' |
Check failure
Code scanning / CodeQL
Checkout of untrusted code in a privileged context Critical
workflow_run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I wonder if there's a good way to do this. The workflow is mirroring the manual steps a person has to take on their own computer or in a codespace today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locking the workflow down to only run for PRs authored by users with write/admin permission on the repo + Dependabot is the advice I got from our security folks.
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using the licensee/setup-licensed action instead of manually installing licensed via gem, as this is consistent with the existing licensed.yml workflow and provides better version management and caching. The existing workflow uses licensee/setup-licensed@v1.3.2 with version: 4.x.
| run: gem install licensed | |
| uses: licensee/setup-licensed@v1.3.2 | |
| with: | |
| version: 4.x |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The step uses npm install which can update package-lock.json, but the other workflows in this repository use npm ci which provides a clean, reproducible install from the existing package-lock.json. Consider using npm ci for consistency, unless the intention is to allow package-lock.json updates as part of the auto-fix.
| run: npm install | |
| run: npm ci |
Check failure
Code scanning / CodeQL
Checkout of untrusted code in a privileged context Critical
workflow_run
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git diff --quiet command only checks unstaged changes, but licensed cache may create new untracked files. This check should use git diff --quiet && git diff --cached --quiet && [ -z "$(git ls-files --others --exclude-standard)" ] or alternatively git status --porcelain to properly detect all changes including untracked files.
This issue also appears in the following locations of the same file:
- line 97
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git add -A command stages all changes in the entire repository. Since this step is specifically for committing licensed cache changes, it would be safer and more explicit to use git add .licenses/ to only stage the licensed cache directory. This prevents accidentally committing unrelated changes and makes the commit's intent clearer.
| git add -A | |
| git add .licenses/ |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The push operation on line 85 could fail if another commit was pushed to the branch between the checkout and this push, resulting in a non-fast-forward error. Consider adding retry logic or pulling before pushing, or document that manual intervention may be needed in such cases.
This issue also appears in the following locations of the same file:
- line 106
Check failure
Code scanning / CodeQL
Checkout of untrusted code in a privileged context Critical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow runs on all CI failures, not just license or bundle related failures. This could result in unnecessary workflow runs and commits for failures unrelated to licenses or bundles. Consider adding logic to check if the failure is actually related to licenses or bundles before attempting fixes, or document this behavior if it's intentional.
This issue also appears in the following locations of the same file: