Skip to content

Commit

Permalink
Add use of the right GH Token and push last tag
Browse files Browse the repository at this point in the history
  • Loading branch information
fantonangeli committed Jan 26, 2024
1 parent 6219b57 commit 7f09c44
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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: |
Expand All @@ -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)

0 comments on commit 7f09c44

Please sign in to comment.