diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d27de6e4b2..7335c2b285 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -19,11 +19,14 @@ Provide the following information: **- How to verify it** -**- Description for the changelog** +**- Human readable description for the release notes** ```markdown changelog diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 0f449d0a03..1b0a7f980f 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -16,6 +16,7 @@ on: jobs: check-area-label: runs-on: ubuntu-20.04 + timeout-minutes: 120 # guardrails timeout for the whole job steps: - name: Missing `area/` label if: contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') && !contains(join(github.event.pull_request.labels.*.name, ','), 'area/') @@ -26,9 +27,10 @@ jobs: run: exit 0 check-changelog: - if: contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') runs-on: ubuntu-20.04 + timeout-minutes: 120 # guardrails timeout for the whole job env: + HAS_IMPACT_LABEL: ${{ contains(join(github.event.pull_request.labels.*.name, ','), 'impact/') }} PR_BODY: | ${{ github.event.pull_request.body }} steps: @@ -40,15 +42,23 @@ jobs: # Strip empty lines desc=$(echo "$block" | awk NF) - if [ -z "$desc" ]; then - echo "::error::Changelog section is empty. Provide a description for the changelog." - exit 1 - fi + if [ "$HAS_IMPACT_LABEL" = "true" ]; then + if [ -z "$desc" ]; then + echo "::error::Changelog section is empty. Please provide a description for the changelog." + exit 1 + fi - len=$(echo -n "$desc" | wc -c) - if [[ $len -le 6 ]]; then - echo "::error::Description looks too short: $desc" - exit 1 + len=$(echo -n "$desc" | wc -c) + if [[ $len -le 6 ]]; then + echo "::error::Description looks too short: $desc" + exit 1 + fi + else + if [ -n "$desc" ]; then + echo "::error::PR has a changelog description, but no changelog label" + echo "::error::Please add the relevant 'impact/' label to the PR or remove the changelog description" + exit 1 + fi fi echo "This PR will be included in the release notes with the following note:" @@ -56,6 +66,7 @@ jobs: check-pr-branch: runs-on: ubuntu-20.04 + timeout-minutes: 120 # guardrails timeout for the whole job env: PR_TITLE: ${{ github.event.pull_request.title }} steps: