diff --git a/.github/workflows/pr-pre-post-merge.yml b/.github/workflows/pr-pre-post-merge.yml new file mode 100644 index 0000000..635780a --- /dev/null +++ b/.github/workflows/pr-pre-post-merge.yml @@ -0,0 +1,25 @@ +name: PR Pre and Post Merge Build + +on: + pull_request: + branches: [ debian/*, qcom/** ] + types: [ opened, synchronize, reopened, closed ] + +permissions: + contents: read + 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). + + name: Build Debian Package + uses: qualcomm-linux/qcom-build-utils/.github/workflows/qcom-build-pkg-reusable-workflow.yml@main + if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }} + 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") + debian-ref: ${{ (github.event.action == 'closed' && github.event.pull_request.merged) && github.event.pull_request.base.ref || github.head_ref }} + debusine-parent-workspace: ${{ vars.DEBUSINE_PARENT_WORKSPACE }}