ci: trigger standalone build when PR labeled with build-artifact (backport #1058) (#1059)

* ci: trigger standalone build when PR labeled with build-artifact (#1058)

* ci: trigger standalone build when PR labeled with build-artifact

Signed-off-by: Andy Lee <andy.lee@suse.com>

* ci: skip upload gate for PR-triggered standalone builds

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
(cherry picked from commit ac26fe2f0e012c6100e27853fa8650f2467cfa79)

* fix: CI_BRANCH

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2026-07-28 14:54:41 +08:00 committed by GitHub
parent a0f21d5902
commit 690652f204
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,13 +13,23 @@ on:
- '*-dev'
types:
- merged
- labeled
jobs:
build-validation:
name: Build Test
# allow triggering when a PR is labeled with "build-artifact"
if: >-
github.event_name != 'pull_request' ||
github.event.action != 'labeled' ||
github.event.label.name == 'build-artifact'
uses: ./.github/workflows/run-lint.yaml
build:
name: Build and Upload Package
if: >-
github.event_name != 'pull_request' ||
github.event.action != 'labeled' ||
github.event.label.name == 'build-artifact'
uses: ./.github/workflows/build-and-publish-standalone.yaml
needs:
- build-validation
@ -28,4 +38,7 @@ jobs:
packages: write
id-token: write
with:
CI_BRANCH: ${{github.ref_name}}
# For PR-triggered runs github.ref_name is "<prNumber>/merge" (not a real
# branch), which breaks the upload gate. Leave CI_BRANCH empty for PRs so
# the gate is skipped; use the real branch name for push events.
CI_BRANCH: ${{ github.event_name == 'push' && github.ref_name || '' }}