-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SRVLOGIC-281: Move upstream-sync CI to kie-ci repository (#1554)
- Loading branch information
1 parent
ac00b15
commit 96a2579
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: 'Sync main-apache branch' | ||
description: 'Sync main-apache branch with upstream/main' | ||
|
||
inputs: | ||
username: | ||
description: 'Username for git' | ||
required: false | ||
default: kie-ci | ||
useremail: | ||
description: 'User email for git' | ||
required: false | ||
default: [email protected] | ||
upstream_remote: | ||
description: 'URL of the upstream remote repository' | ||
required: true | ||
dry_run: | ||
description: 'True to perform a dry run (dry run git push and skip create PR step)' | ||
required: false | ||
default: false | ||
|
||
runs: | ||
if: github.repository_owner == 'kiegroup' | ||
using: 'composite' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
|
||
- name: Setup git environment | ||
shell: bash | ||
run: | | ||
set -x | ||
git config --global user.name "${{ inputs.username }}" | ||
git config --global user.email "${{ inputs.useremail }}" | ||
git remote add upstream ${{ inputs.upstream_remote }} | ||
- name: Fetch all | ||
shell: bash | ||
run: git fetch --all --tags | ||
|
||
- name: Checkout main-apache branch | ||
shell: bash | ||
run: git checkout --track origin/main-apache | ||
|
||
- name: Pull main-apache branch | ||
shell: bash | ||
run: git pull | ||
|
||
- name: Merge upstream/main branch | ||
shell: bash | ||
run: git merge --no-edit upstream/main | ||
|
||
- name: Push changes | ||
shell: bash | ||
run: | | ||
set -x | ||
git push${{ inputs.dry_run == 'true' && ' --dry-run' || '' }} | ||
- name: Push last tag | ||
shell: bash | ||
run: | | ||
set -x | ||
git push origin $(git tag --sort=creatordate | tail -n 1)${{ inputs.dry_run == 'true' && ' --dry-run' || '' }} |