Skip to content

Commit

Permalink
workflows: teach dependabot workflow to rebase
Browse files Browse the repository at this point in the history
Our dependabot workflow is unable to deal with conflicting node_modules
when we land one of the dependabot pull requests. The manual workflow
before was to let dependabot re-create the pull request and then add the
`node_modules` label after re-recreating the pull request. Automating
this is tricky as a Github workflow cannot automate the recreate comment
as it has no write permissions to our projects.

The new approach when adding a `node_modules` label will always rebase
the pull request and in case of a conflict will remove the conflicting
node_modules changes in the commit. Afterwards we create the new
node_modules commit which can be merged.
  • Loading branch information
jelly committed Oct 28, 2024
1 parent 006d8d3 commit 14e7c04
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ jobs:
}
}
- name: Rebase pull request and drop node_modules changes
run: |
set -x
git config --global user.name "GitHub Workflow"
git config --global user.email "[email protected]"
git fetch origin main:main
if ! git rebase main; then
git reset node_modules
GIT_EDITOR=true git rebase --continue
git show --stat
fi
- name: Update node_modules for package.json changes
run: |
make tools/node-modules
Expand Down

0 comments on commit 14e7c04

Please sign in to comment.