From a3bbd6105db527b6f464424b8d5a741e82267c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 14 Nov 2023 07:47:15 +0100 Subject: [PATCH 1/4] Push simply by `git push` --- .github/workflows/go.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 959c2e88..73767f09 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -60,6 +60,8 @@ jobs: needs: download runs-on: ubuntu-latest name: Update coverage badge + permissions: + contents: write steps: - uses: actions/checkout@v3 with: @@ -122,10 +124,4 @@ jobs: git config --local user.name "GitHub Action" git add README.md index.md git commit -m "chore: Updated coverage badge." - - - name: Push changes - if: steps.generate-badge.outputs.badge_updates == 'true' && github.event_name != 'pull_request' - uses: ad-m/github-push-action@master - with: - github_token: ${{ github.token }} - branch: ${{ github.ref }} + git push From 958afd360940138d1d786a3247e57633da225a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 30 Nov 2023 18:07:15 +0100 Subject: [PATCH 2/4] Remove persist-credentials --- .github/workflows/go.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cc6d2452..f70fcd2f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -67,7 +67,6 @@ jobs: steps: - uses: actions/checkout@v3 with: - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - name: Set up Go From 5db0104c10049e83b0ac4f79e48d687d997dce2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 30 Nov 2023 18:20:25 +0100 Subject: [PATCH 3/4] Revert to git status --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f70fcd2f..dc3bb656 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -111,7 +111,7 @@ jobs: done # Check to see if files were updated - if git diff --quiet; then + if git status --porcelain; then echo "badge_updates=true" >> "${GITHUB_OUTPUT}" else echo "badge_updates=false" >> "${GITHUB_OUTPUT}" From f3fbc989ccb07bb33dd1a01a4fe4244aec9b8e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 30 Nov 2023 18:44:01 +0100 Subject: [PATCH 4/4] Put back git diff the right way --- .github/workflows/go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dc3bb656..40b9e41b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -111,10 +111,10 @@ jobs: done # Check to see if files were updated - if git status --porcelain; then - echo "badge_updates=true" >> "${GITHUB_OUTPUT}" - else + if git diff --quiet; then echo "badge_updates=false" >> "${GITHUB_OUTPUT}" + else + echo "badge_updates=true" >> "${GITHUB_OUTPUT}" fi - name: Commit changes