-
Notifications
You must be signed in to change notification settings - Fork 31
ci: Amend dependabot commits to use Cargo.lock file version 3 #898
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,35 @@ | ||||||
| name: Run custom steps on Dependabot PRs | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe also ad filter when changes are touching the lock file? As there's no need for go updates |
||||||
| types: [opened, synchronize] | ||||||
| branches: | ||||||
| - main | ||||||
|
|
||||||
| jobs: | ||||||
| amend-dependabot-commit: | ||||||
| if: github.actor == 'dependabot[bot]' | ||||||
| runs-on: ubuntu-24.04 | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout PR branch | ||||||
| uses: actions/checkout@v4 | ||||||
| with: | ||||||
| ref: ${{ github.head_ref }} | ||||||
|
|
||||||
| - name: Use Cargo lock file version 3 | ||||||
| run: | | ||||||
| # This is a workaround for the issue that dependabot updates the | ||||||
| # Cargo.lock file to version 4, which is not available in Noble. | ||||||
| cargo generate-lockfile | ||||||
|
|
||||||
| - name: Amend commit and push | ||||||
| run: | | ||||||
| if git diff --quiet; then | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we be explicit on file?
Suggested change
|
||||||
| echo "No changes to commit." | ||||||
| exit 0 | ||||||
| fi | ||||||
|
|
||||||
| git add -A | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| git commit --amend --no-edit | ||||||
| git push --force | ||||||
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.
Ah you may need to add permissions:
(maybe contents isn't needed?)