diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 532c8ec097cd..97a985c6cbc1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -111,6 +111,29 @@ jobs: outputs: PASSED: ${{ steps.set-output.outputs.PASSED }} steps: + - name: Evaluate branch for changelog lint handling + id: evaluate-branch + run: | + BRANCH_NAME="${{ github.ref_name }}" + if [[ "$BRANCH_NAME" == Version-v* ]]; then + echo "Branch starts with Version-v. Ignoring failure for test-lint-changelog." + echo "IGNORE_CHANGELOG_FAILURE=true" >> "$GITHUB_ENV" + else + echo "IGNORE_CHANGELOG_FAILURE=false" >> "$GITHUB_ENV" + fi + + - name: Validate test-lint-changelog outcome + id: validate-changelog-job + run: | + TEST_LINT_CHANGELOG_FAILED="${{ needs.test-lint-changelog.result }}" + if [[ "$TEST_LINT_CHANGELOG_FAILED" == "failure" && "$IGNORE_CHANGELOG_FAILURE" == "true" ]]; then + echo "test-lint-changelog failed, but we're ignoring it for Version-v branches." + elif [[ "$TEST_LINT_CHANGELOG_FAILED" == "failure" ]]; then + echo "test-lint-changelog failed and cannot be ignored." + exit 1 + fi + echo "All jobs completed successfully." + - name: Set PASSED output id: set-output run: echo "PASSED=true" >> "$GITHUB_OUTPUT"