Sync main-apache branch #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync main-apache branch with upstream/main | |
env: | |
USERNAME: kie-ci | |
USEREMAIL: kie-ci0@redhat.com | |
UPSTREAM_REMOTE: https://github.com/apache/incubator-kie-kogito-runtimes.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 | |
- 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 | |