Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dependabot-force-rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
contents: write # 👈 allows pushing commits to branches
pull-requests: write # 👈 allows updating PR metadata
steps:
- uses: peter-evans/rebase@v3
- uses: peter-evans/rebase@v2
35 changes: 35 additions & 0 deletions .github/workflows/pr-auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Dependabot Auto Approve
on:
pull_request:
types:
- opened
- synchronize
- reopened

permissions:
pull-requests: write
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
auto-approve:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' || github.actor == 'nev21'
steps:
- name: Wait for status checks
uses: lewagon/wait-on-check-action@v1.4.1
with:
ref: ${{ github.event.pull_request.head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
running-workflow-name: 'auto-approve'
allowed-conclusions: success,skipped,neutral

- name: Approve PR
if: success()
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75 changes: 75 additions & 0 deletions .github/workflows/sync-rush-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Sync Rush.json Version
on:
pull_request:
types: [opened, synchronize]
paths:
- "**/package.json"
- "rush.json"
- "common-versions.json"

jobs:
detect:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
outputs:
rush_changed: ${{ steps.detect.outputs.rush_changed }}
steps:
- uses: actions/checkout@v6

- name: Detect Rush bump
id: detect
run: |
# Look for @microsoft/rush in the diff
if git diff -U0 HEAD~1 -- **/package.json | grep '"@microsoft/rush"'; then
Copy link

Copilot AI Dec 15, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
echo "rush_changed=true" >> $GITHUB_OUTPUT
else
echo "rush_changed=false" >> $GITHUB_OUTPUT
fi

update:
runs-on: ubuntu-latest
needs: detect
if: needs.detect.outputs.rush_changed == 'true'
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20

- name: Install Rush
run: npm install -g @microsoft/rush

- name: Sync rush.json
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)
Copy link

Copilot AI Dec 15, 2025

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.

Copilot uses AI. Check for mistakes.

# Update rush.json version field
jq ".rushVersion = \"$NEW_VERSION\"" rush.json > rush.tmp.json
mv rush.tmp.json rush.json

- name: Run rush update
run: |
rush update --full

- name: Commit changes
run: |
git config --global user.name "dependabot-sync[bot]"
git config --global user.email "dependabot-sync[bot]@users.noreply.github.com"
git add rush.json || true
git add common-versions.json || true
git add pnpm-lock.yaml || true
git add yarn.lock || true
git add package-lock.json || true
if git diff --staged --quiet; then
echo "No changes to commit."
else
git commit -m "chore: sync rush.json and regenerate lockfiles"
git push --force-with-lease
Copy link

Copilot AI Dec 15, 2025

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.

Copilot uses AI. Check for mistakes.
fi