From b02218386235e6d40a11a48b5b1171e9acf8d1eb Mon Sep 17 00:00:00 2001 From: Marco Ceppi Date: Fri, 23 Dec 2022 20:00:33 -0500 Subject: [PATCH] feat: tag PR builds independently from matrix.version, latest, and stable --- .github/workflows/build.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b01ae25fd..92b2a284cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,14 +37,19 @@ jobs: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT alias_tags=() - if [[ "${{ matrix.is_latest }}" == "true" ]]; then - alias_tags+=("latest") - fi - if [[ "${{ matrix.is_stable }}" == "true" ]]; then - alias_tags+=("stable") + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + alias_tags+=("pr-${{ github.event.number }}") + else + alias_tags+=("${{ matrix.major_version }}") + if [[ "${{ matrix.is_latest }}" == "true" ]]; then + alias_tags+=("latest") + fi + if [[ "${{ matrix.is_stable }}" == "true" ]]; then + alias_tags+=("stable") + fi fi echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT - + # Build image using Buildah action - name: Build Image id: build_image @@ -57,7 +62,6 @@ jobs: ${{ steps.generate-tags.outputs.alias_tags }} ${{ steps.generate-tags.outputs.date }} ${{ steps.generate-tags.outputs.sha_short }} - ${{ matrix.major_version }} build-args: | FEDORA_MAJOR_VERSION=${{ matrix.major_version }} oci: true