chore: build main-head on PR merge (#302)

* chore: add main branch

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>

* ci: add dev branch

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>

---------

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
Yiya Chen 2025-05-16 15:42:38 +08:00 committed by GitHub
parent cbfcf4dbae
commit 4f3e532327
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ on:
push: push:
branches: branches:
- 'release-harvester-v*' - 'release-harvester-v*'
- 'main'
jobs: jobs:
setup-target-branch: setup-target-branch:
@ -17,14 +18,17 @@ jobs:
- name: Determine target branch - name: Determine target branch
id: get-version id: get-version
run: | run: |
if [[ "${{ github.ref_name }}" =~ ^release-harvester-v([0-9]+\.[0-9]+)$ ]]; then if [[ "${{ github.ref_name }}" == "main" ]]; then
TARGET_BRANCH="main-head"
elif [[ "${{ github.ref_name }}" =~ ^release-harvester-v([0-9]+\.[0-9]+)$ ]]; then
TARGET_BRANCH="v${BASH_REMATCH[1]}-head" TARGET_BRANCH="v${BASH_REMATCH[1]}-head"
echo "target_branch=${TARGET_BRANCH}" >> $GITHUB_ENV
echo "target_branch=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
else else
echo "Error: invalid branch format." && exit 1 echo "Error: invalid branch format." && exit 1
fi fi
echo "target_branch=${TARGET_BRANCH}" >> $GITHUB_ENV
echo "target_branch=${TARGET_BRANCH}" >> $GITHUB_OUTPUT
- name: Ensure target branch exists - name: Ensure target branch exists
run: | run: |
git fetch --all git fetch --all