From 7037c977ebdf3c81b1de923ede323c775ffb279d Mon Sep 17 00:00:00 2001 From: David Tesar Date: Wed, 13 Mar 2024 07:57:55 -0700 Subject: [PATCH] Change release job logic to handle more files (#4631) * Change logic for only one file Signed-off-by: David Tesar * Filter proper changed files Signed-off-by: David Tesar * Fix logic Signed-off-by: David Tesar --------- Signed-off-by: David Tesar --- .github/workflows/release.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7e811b23242..dd3c4ecf7eb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,16 +28,18 @@ jobs: with: fetch-depth: 0 - name: Get changed files - id: changed-files + id: changed-markdown-files uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # tag=v42.1.0 + with: + files: CHANGELOG/**.md - name: Get release version id: release-version run: | - if [[ ${{ steps.changed-files.outputs.all_changed_files_count }} != 1 ]]; then - echo "1 release notes file should be changed to create a release tag, found ${{ steps.changed-files.outputs.all_changed_files_count }}" + if [[ ${{ steps.changed-markdown-files.outputs.all_changed_files_count }} != 1 ]]; then + echo "1 release notes file should be changed to create a release tag, found ${{ steps.changed-markdown-files.outputs.all_changed_files_count }}" exit 1 fi - for changed_file in ${{ steps.changed-files.outputs.all_changed_files }}; do + for changed_file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do export RELEASE_VERSION=$(echo "${changed_file}" | grep -oP '(?<=/)[^/]+(?=\.md)') echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT @@ -121,4 +123,4 @@ jobs: draft: true files: out/* body_path: ${{ env.RELEASE_TAG }}.md - tag_name: ${{ env.RELEASE_TAG }} + tag_name: ${{ env.RELEASE_TAG }} \ No newline at end of file