From fddaec7a9ee563447e24ebb16277fc674db32627 Mon Sep 17 00:00:00 2001 From: GitHub Service Bot Date: Sat, 23 May 2026 01:05:42 +0000 Subject: [PATCH] chore: sync pr-pre-post-merge from qcom-build-utils Signed-off-by: GitHub Service Bot --- .github/workflows/pr-pre-post-merge.yml | 35 +++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-pre-post-merge.yml b/.github/workflows/pr-pre-post-merge.yml index 635780a..019309d 100644 --- a/.github/workflows/pr-pre-post-merge.yml +++ b/.github/workflows/pr-pre-post-merge.yml @@ -10,16 +10,41 @@ permissions: packages: read jobs: - build: - # This condition ensures that the job runs for all PR actions except closed unmerged, - # i.e., it runs for opened, synchronize, reopened (pre-merge) and closed merged (post-merge). + resolve-suite: + name: Resolve suite from branch + runs-on: ubuntu-latest + outputs: + suite: ${{ steps.resolve.outputs.suite }} + steps: + - name: Derive suite from target branch + id: resolve + env: + BASE_REF: ${{ github.base_ref }} + run: | + set -euo pipefail + case "$BASE_REF" in + qcom/ubuntu/*|qcom/debian/*) + suite="${BASE_REF##*/}" + ;; + *) + suite=sid + ;; + esac + echo "suite=$suite" >> "$GITHUB_OUTPUT" + echo "Resolved suite: $suite (from branch: $BASE_REF)" + build: name: Build Debian Package - uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-build-pkg-reusable-workflow.yml@main + needs: resolve-suite if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }} + uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-build-pkg-reusable-workflow.yml@main with: qcom-build-utils-ref: main # PRE-MERGE: use the PR head branch (github.head_ref) - # POST-MERGE: use the base branch name from the PR (e.g. "debian/qcom-next") + # POST-MERGE: use the base branch name from the PR debian-ref: ${{ (github.event.action == 'closed' && github.event.pull_request.merged) && github.event.pull_request.base.ref || github.head_ref }} + suite: ${{ needs.resolve-suite.outputs.suite }} debusine-parent-workspace: ${{ vars.DEBUSINE_PARENT_WORKSPACE }} + secrets: + DEBUSINE_USER: ${{ secrets.DEBUSINE_USER }} + DEBUSINE_TOKEN: ${{ secrets.DEBUSINE_TOKEN }}