-
-
Notifications
You must be signed in to change notification settings - Fork 0
Update dependabot actions #178
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
Conversation
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.
Pull request overview
This PR updates the Dependabot-related GitHub Actions workflows by introducing new automation for Rush.json synchronization and PR auto-approval, while removing the auto-merge workflow and downgrading the rebase action version.
Key Changes:
- Adds automated Rush.json version synchronization when Dependabot updates the Rush dependency
- Replaces auto-merge workflow with a safer auto-approve workflow that waits for status checks
- Downgrades the rebase action from v3 to v2
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/sync-rush-versions.yml |
New workflow to automatically sync Rush.json version with Dependabot updates and regenerate lockfiles |
.github/workflows/pr-auto-approve.yml |
New workflow to auto-approve PRs from Dependabot and nev21 after status checks pass |
.github/workflows/dependabot-force-rebase.yml |
Downgrades peter-evans/rebase action from v3 to v2 |
.github/workflows/dependabot-auto-merge.yml |
Removes the auto-merge workflow entirely |
| id: detect | ||
| run: | | ||
| # Look for @microsoft/rush in the diff | ||
| if git diff -U0 HEAD~1 -- **/package.json | grep '"@microsoft/rush"'; then |
Copilot
AI
Dec 15, 2025
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 command assumes HEAD1 exists, which will fail on the first commit of a new branch or repository. Consider using 'origin/${{ github.base_ref }}' or checking if HEAD1 exists before running the diff.
| if git diff -U0 HEAD~1 -- **/package.json | grep '"@microsoft/rush"'; then | |
| if git diff -U0 origin/${{ github.base_ref }} -- **/package.json | grep '"@microsoft/rush"'; then |
| run: | | ||
| echo "Syncing rush.json with Dependabot bump..." | ||
| # Extract new Rush version from package.json | ||
| NEW_VERSION=$(jq -r '.devDependencies["@microsoft/rush"] // .dependencies["@microsoft/rush"]' package.json) |
Copilot
AI
Dec 15, 2025
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.
If the @microsoft/rush dependency is not found in package.json, NEW_VERSION will be empty or 'null', leading to an invalid rush.json update. Add validation to ensure NEW_VERSION is not empty before proceeding with the update.
| echo "No changes to commit." | ||
| else | ||
| git commit -m "chore: sync rush.json and regenerate lockfiles" | ||
| git push --force-with-lease |
Copilot
AI
Dec 15, 2025
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.
Using --force-with-lease on Dependabot PRs could overwrite commits if the branch has been updated elsewhere. Since this workflow uses GITHUB_TOKEN and runs on pull_request events, consider whether force-pushing is appropriate or if regular push with proper error handling would be safer.
No description provided.