1name: Clippy changelog check23on:4 merge_group:5 pull_request:6 types: [opened, reopened, synchronize, edited]78concurrency:9 # For a given workflow, if we push to the same PR, cancel all previous builds on that PR.10 # If the push is not attached to a PR, we will cancel all builds on the same branch.11 group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"12 cancel-in-progress: true1314jobs:15 changelog:16 runs-on: ubuntu-latest1718 steps:19 # Run20 - name: Check Changelog21 if: ${{ github.event_name == 'pull_request' }}22 run: |23 # Checks that the PR body contains a changelog entry, ignoring the placeholder from the PR template.24 if [[ -z $(grep -oP 'changelog: *\K(?!\[`lint_name`\])\S+' <<< "$PR_BODY") ]]; then25 echo "::error::Pull request message must contain 'changelog: ...' with your changelog. Please add it."26 exit 127 fi28 env:29 PR_BODY: ${{ github.event.pull_request.body }})303132 # We need to have the "conclusion" job also on PR CI, to make it possible33 # to add PRs to a merge queue.34 conclusion_changelog:35 needs: [ changelog ]36 # We need to ensure this job does *not* get skipped if its dependencies fail,37 # because a skipped job is considered a success by GitHub. So we have to38 # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run39 # when the workflow is canceled manually.40 #41 # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!42 if: ${{ !cancelled() }}43 runs-on: ubuntu-latest44 steps:45 # Manually check the status of all dependencies. `if: failure()` does not work.46 - name: Conclusion47 run: |48 # Print the dependent jobs to see them in the CI log49 jq -C <<< '${{ toJson(needs) }}'50 # Check if all jobs that we depend on (in the needs array) were successful.51 jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
Findings
✓ No findings reported for this file.