From 3bd9f1292841ddc8453c7b2856286c36d6a3690b Mon Sep 17 00:00:00 2001 From: Lukasz Dziedziak Date: Fri, 22 Nov 2024 10:07:07 +0100 Subject: [PATCH] chore(action): fix script executable and change token order (#7) Signed-off-by: Lukasz Dziedziak --- .github/scripts/get-version-tags.sh | 0 .github/workflows/sync-with-upstream.yaml | 12 ++++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) mode change 100644 => 100755 .github/scripts/get-version-tags.sh diff --git a/.github/scripts/get-version-tags.sh b/.github/scripts/get-version-tags.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/sync-with-upstream.yaml b/.github/workflows/sync-with-upstream.yaml index 5341ecef9..8b338f81a 100644 --- a/.github/workflows/sync-with-upstream.yaml +++ b/.github/workflows/sync-with-upstream.yaml @@ -19,20 +19,22 @@ jobs: runs-on: ubuntu-latest name: Sync with upstream main steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + with: + fetch-depth: 0 + persist-credentials: false - name: Generate GitHub app token id: github-app-token uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 with: app-id: ${{ secrets.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - fetch-depth: 0 - token: ${{ steps.github-app-token.outputs.token }} - name: Sync upstream changes id: sync uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 with: + git_config_user: ${{ env.GH_USER }} + git_config_email: ${{ env.GH_EMAIL }} target_sync_branch: main target_repo_token: ${{ steps.github-app-token.outputs.token }} target_branch_push_args: "-f --tags" @@ -53,6 +55,7 @@ jobs: shell: bash run: ".github/scripts/get-version-tags.sh" - name: Print tags + if: steps.sync.outputs.has_new_commits == 'true' run: | echo "Current fork tag: ${{ steps.new-version-tag.outputs.released_tag }}" echo "Newest upstream tag: ${{ steps.new-version-tag.outputs.main_tag }}" @@ -61,6 +64,7 @@ jobs: if: steps.new-version-tag.outputs.released_tag != steps.new-version-tag.outputs.main_tag run: | git remote -v + git remote set-url origin https://${{ steps.github-app-token.outputs.token }}@github.com/kumahq/go-control-plane.git git config user.name "${GH_USER}" git config user.email "${GH_EMAIL}" git checkout release