diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 01a5b14eac7..88b1e9b98c7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,29 +28,28 @@ jobs: with: fetch-depth: 0 - name: Get changed files - id: changed-files + id: changed-markdown-files uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188 # tag=v42.0.5 with: - files: | - 'CHANGELOG/**.md' + 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 - export RELEASE_VERSION=$(echo "${changed_file}" | grep -oP '(?<=/)[^/]+(?=\.md)') - echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV - echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT - if [[ "$RELEASE_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then - echo "Valid semver: $RELEASE_VERSION" - else - echo "Invalid semver: $RELEASE_VERSION" - exit 1 - fi - done + 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 + if [[ "$RELEASE_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then + echo "Valid semver: $RELEASE_VERSION" + else + echo "Invalid semver: $RELEASE_VERSION" + exit 1 + fi + done - name: Determine the release branch to use run: | if [[ $RELEASE_VERSION =~ beta ]] || [[ $RELEASE_VERSION =~ alpha ]]; then