Skip to content

Commit

Permalink
Merge pull request #3 from fantonangeli/SRVLOGIC-202-Schedule-apache-…
Browse files Browse the repository at this point in the history
…main-sync-from-upstream

SRVLOGIC-202: Schedule apache-main sync from upstream
  • Loading branch information
ricardozanini authored Jan 26, 2024
2 parents 9195350 + 7f09c44 commit 96f4cee
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Sync main-apache branch with upstream/main

env:
USERNAME: kie-ci
USEREMAIL: [email protected]
UPSTREAM_REMOTE: https://github.com/apache/incubator-kie-kogito-serverless-operator.git
GITHUB_TOKEN: ${{ secrets.APACHE_SYNC_MIDSTREAM_TOKEN }}

on:
schedule:
- cron: "0 0 * * *" # every day at midnight
workflow_dispatch:

jobs:
sync-main-apache:
name: Sync main-apache branch
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.APACHE_SYNC_MIDSTREAM_TOKEN }}

- name: Setup git environment
run: |
git config --global user.name "$USERNAME"
git config --global user.email "$USEREMAIL"
git remote add upstream $UPSTREAM_REMOTE
- name: 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

- name: Push last tag
run: git push origin $(git tag --sort=creatordate | tail -n 1)

0 comments on commit 96f4cee

Please sign in to comment.