Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRVLOGIC-281: Move upstream-sync CI to kie-ci repository #1554

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .ci/actions/upstream-sync/action.yml
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' || '' }}
Loading