forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: move dependabot updating process to Gtihub Actions (solana-labs#1466
) * add dependabot-pr Github Actions * move updating dependabot pr process to Github Actions * update user.email and user.name to dependabot itself * only add for cargo.lock * don't push anything if nothing to update
- Loading branch information
Showing
6 changed files
with
48 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Dependabot PR | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
dependabot: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
if: github.triggering_actor == 'dependabot[bot]' | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
token: ${{ secrets.PAT }} | ||
|
||
- name: update code | ||
run: | | ||
input="${{ github.event.pull_request.title }}" | ||
regex="[Bb]ump (.*) from (.*) to (.*)" | ||
if [[ ! "$input" =~ $regex ]]; then | ||
echo "unexpected pattern" | ||
exit 1 | ||
fi | ||
crate_name="${BASH_REMATCH[1]}" | ||
old_version="${BASH_REMATCH[2]}" | ||
new_version="${BASH_REMATCH[3]}" | ||
echo "crate_name: $crate_name, old_version: $old_version, new_version: $new_version" | ||
./scripts/cargo-for-all-lock-files.sh -- update -p $crate_name:$old_version --precise $new_version | ||
./scripts/cargo-for-all-lock-files.sh -- tree | ||
- name: push | ||
run: | | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "✅ Nothing to update" | ||
else | ||
git config user.email "49699333+dependabot[bot]@users.noreply.github.com" | ||
git config user.name "dependabot[bot]" | ||
git add **/Cargo.lock | ||
git commit -am "update all Cargo files" | ||
git push | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.