From 7f09c44b840126cc54ff20e94f6f4839b11818c6 Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Fri, 26 Jan 2024 10:28:18 +0100 Subject: [PATCH] Add use of the right GH Token and push last tag --- .github/workflows/upstream-sync.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index 5b14a198d..7ef9facaa 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -1,9 +1,10 @@ name: Sync main-apache branch with upstream/main env: - USERNAME: github-actions[bot] - USEREMAIL: github-actions[bot]@users.noreply.github.com + USERNAME: kie-ci + USEREMAIL: kie-ci0@redhat.com UPSTREAM_REMOTE: https://github.com/apache/incubator-kie-kogito-serverless-operator.git + GITHUB_TOKEN: ${{ secrets.APACHE_SYNC_MIDSTREAM_TOKEN }} on: schedule: @@ -17,7 +18,9 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + token: ${{ secrets.APACHE_SYNC_MIDSTREAM_TOKEN }} - name: Setup git environment run: | @@ -26,14 +29,19 @@ jobs: git remote add upstream $UPSTREAM_REMOTE - name: Fetch all - run: git fetch --all + run: git fetch --all --tags - name: Checkout main-apache branch run: git checkout --track origin/main-apache + - name: Pull main-apache branch + run: git pull + - name: Merge upstream/main branch run: git merge --no-edit upstream/main - name: Push changes - run: git push origin main-apache + run: git push + - name: Push last tag + run: git push origin $(git tag --sort=creatordate | tail -n 1)