From b4f3679908426b41f769816294ed857ea03ba081 Mon Sep 17 00:00:00 2001 From: Shahar Glazner Date: Tue, 3 Sep 2024 13:21:02 +0300 Subject: [PATCH] fix: release workflow naming convention problem (#1815) --- .github/workflows/release.yml | 4 ++-- .github/workflows/test-pr.yml | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94b3a8953..d4020f083 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,10 +49,10 @@ jobs: - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ steps.release-step.outputs.version }} + tag: "v${{ steps.release-step.outputs.version }}" run: | gh release create "$tag" \ --repo="$GITHUB_REPOSITORY" \ - --title="${{ steps.release-step.outputs.version }}" \ + --title="v${{ steps.release-step.outputs.version }}" \ --target="release/${{ steps.release-step.outputs.version }}" \ --generate-notes diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index ae1ecf85f..cf2156466 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -1,12 +1,10 @@ name: Tests on: push: - paths: - - 'keep/**' pull_request: - paths: - - 'keep/**' workflow_dispatch: +permissions: + actions: write concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true @@ -19,9 +17,24 @@ env: ELASTIC_PASSWORD: keeptests jobs: + check-before-unit-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check if relevant files have changed + id: file_check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if ! git diff --name-only $BASE_SHA $HEAD_SHA | grep -q '^keep/'; then + echo "No relevant changes, cancelling job." + exit 78 + fi tests: runs-on: ubuntu-latest - + needs: + - check-before-unit-tests services: mysql: image: mysql:5.7