diff --git a/.github/workflows/upgrade-actions.yml b/.github/workflows/upgrade-actions.yml index e21894b..623ba24 100644 --- a/.github/workflows/upgrade-actions.yml +++ b/.github/workflows/upgrade-actions.yml @@ -27,12 +27,17 @@ jobs: matrix: repo: ${{ fromJson(needs.define-matrix.outputs.repos) }} steps: - - uses: actions/checkout@v5 - - name: Clone repository - run: git clone https://github.com/nspcc-dev/${{matrix.repo}}.git + - name: Clone repo + uses: actions/checkout@v5 + with: + repository: https://github.com/nspcc-dev/${{matrix.repo}}.git + token: ${{ GH_TOKEN }} + + - name: Checkout upgrade-actions branch + run: git checkout -b upgrade-actions || git checkout upgrade-actions + - name: Upgrade, commit and push changes run: | - cd ${{matrix.repo}} for action in "actions/checkout" "actions/setup-go" "golangci/golangci-lint-action" "codecov/codecov-action"; do latestVersion="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2026-03-10" /repos/${action}/releases/latest | jq .tag_name -r)" latestVersion="${latestVersion%%.*}" @@ -43,7 +48,6 @@ jobs: if [[ $(git diff) ]]; then echo "Committing git diff..." git diff - git checkout -b upgrade-actions git config user.name "Sami" git config user.email "sami@nspcc.ru" git add .github @@ -52,8 +56,7 @@ jobs: git push --set-upstream origin upgrade-actions gh pr create --base master --head upgrade-actions --title ".github: upgrade Actions" --body "Upgrade GitHub Actions to the latest version." else - echo "Everything is up to date." + echo "Everything is up to date, nothing to commit." fi - cd ../ env: GH_TOKEN: ${{ secrets.SAMI_GHACTION_UPGRADE_TOKEN }}