Skip to content

Commit

Permalink
SRVLOGIC-202: Schedule apache-main sync from upstream (#2)
Browse files Browse the repository at this point in the history
* Test sync CI workflow with midstream

* Testing with real upstream remote

* Add write permissions to actions

* Add content permissions

* Fix workflow key

* only contents

* only actions permissions

* Removed permissions

* Add pull step before push

* Fixed git pull

* Changed to simple push

* Retry action permissions

* All permissions

* Try checkout@v4

* Removed permissions line

* Changed user to kie-ci

* Add full kie-ci signature

* Changed to main-apache-test branch

* replace main-apache-test by main-apache
  • Loading branch information
fantonangeli authored Dec 22, 2023
1 parent 9c58b38 commit f8249c1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/upstream-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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

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

- 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

0 comments on commit f8249c1

Please sign in to comment.