chore(deps): bump golang.org/x/tools from 0.22.0 to 0.26.0 #11
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
name: Sync Dependencies | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
types: | |
- 'opened' | |
- 'synchronize' | |
- 'reopened' | |
jobs: | |
sync-dependencies: | |
if: github.actor == 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.0 | |
- name: Sync all dependencies | |
run: | | |
find . -name 'go.mod' -execdir go mod tidy \; | |
- name: Check for changes | |
id: git_status | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "has_changes=true" >> $GITHUB_ENV | |
else | |
echo "has_changes=false" >> $GITHUB_ENV | |
fi | |
- name: Commit and push changes | |
if: env.has_changes == 'true' | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "chore(deps): sync updated dependencies [dependabot skip]" | |
git push origin HEAD:${{ github.head_ref }} | |
- name: No changes | |
if: env.has_changes == 'false' | |
run: | | |
echo "No changes detected" |