From 2c980e99b1dd9b0039e2e27ff9cb3b6d64fbd8f1 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 31 May 2024 01:05:51 -0400 Subject: [PATCH] [35] use labels to build Docker PRs (#2088) --- .github/workflows/validate.yml | 20 ++++++++------------ VERSION | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 407d8cd8..d6deb062 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,6 +1,8 @@ name: Validate Pull Request -on: pull_request +on: + pull_request: + types: [opened, synchronize, reopened, labeled] jobs: @@ -30,15 +32,9 @@ jobs: docker-build: runs-on: ubuntu-latest needs: [ validate-pull ] - if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.base_ref == 'nightly' && startswith(github.head_ref, 'docker-') + if: contains(github.event.pull_request.labels.*.name, 'docker') steps: - - name: Create Tag - id: create-tag - run: | - var="${{ github.head_ref }}" - echo "docker-tag=${var:7}" >> $GITHUB_OUTPUT - - name: Check Out Repo uses: actions/checkout@v4 with: @@ -66,10 +62,10 @@ jobs: context: ./ file: ./Dockerfile build-args: | - "BRANCH_NAME=${{ steps.create-tag.outputs.docker-tag }}" + "BRANCH_NAME=${{ github.head_ref }}" platforms: linux/amd64,linux/arm64 push: true - tags: kometateam/kometa:${{ steps.create-tag.outputs.docker-tag }} + tags: kometateam/kometa:${{ github.head_ref }} cache-from: type=gha cache-to: type=gha,mode=max @@ -78,7 +74,7 @@ jobs: if: success() with: webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} - title: "${{ vars.REPO_NAME }} ${{ steps.create-tag.outputs.docker-tag }}: ${{ vars.TEXT_SUCCESS }}" + title: "${{ vars.REPO_NAME }} ${{ github.head_ref }}: ${{ vars.TEXT_SUCCESS }}" url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} color: ${{ vars.COLOR_SUCCESS }} username: ${{ vars.BOT_NAME }} @@ -92,7 +88,7 @@ jobs: with: webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} message: ${{ vars.BUILD_FAILURE_ROLE }} - title: "${{ vars.REPO_NAME }} ${{ steps.create-tag.outputs.docker-tag }}: ${{ vars.TEXT_FAILURE }}" + title: "${{ vars.REPO_NAME }} ${{ github.head_ref }}: ${{ vars.TEXT_FAILURE }}" url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }} color: ${{ vars.COLOR_FAILURE }} username: ${{ vars.BOT_NAME }} diff --git a/VERSION b/VERSION index 452c9371..5bd79a5d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.1-build34 +2.0.1-build35