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)