diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2024-11-20 15:57:47 +0100 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2024-11-22 11:32:12 +0000 |
commit | 0cb51bb0c1a42d9248bb956cef85c2f2c3c846db (patch) | |
tree | 7f9c75258c61c416179ec242aed88797f27fcd9d | |
parent | 90454a91a0c7292939204f24369a6041364ffd9a (diff) | |
download | gcc-0cb51bb0c1a42d9248bb956cef85c2f2c3c846db.zip gcc-0cb51bb0c1a42d9248bb956cef85c2f2c3c846db.tar.gz gcc-0cb51bb0c1a42d9248bb956cef85c2f2c3c846db.tar.bz2 |
Add a new CI step to detect raw issue references
Issue references shall now be used with the Rust GCC prefix in order to
avoid mixing gccrs issues and GCC bugzilla PRs.
ChangeLog:
* .github/workflows/commit-format.yml: Add a new step to detect issue
references in commit messages.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r-- | .github/workflows/commit-format.yml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/.github/workflows/commit-format.yml b/.github/workflows/commit-format.yml index 62914c1..621f980 100644 --- a/.github/workflows/commit-format.yml +++ b/.github/workflows/commit-format.yml @@ -108,3 +108,33 @@ jobs: done < <(git rev-list --reverse "$rev_list" ) exit $retval; + + check-issue-reference: + runs-on: ubuntu-latest + continue-on-error: true # We do not want to block merge if it is a legitimate GCC bugzilla reference. + name: check-issue-reference + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Check for issue number reference in commit messages + run: | + retval=0; + rev_list="origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}" + for commit in $(git rev-list --reverse "$rev_list"); do + if [ "$(git log --format=%B -n 1 \"$commit\" | grep '#[0-9]*' | grep -v -i 'Rust-GCC/gccrs#[0-9]*' | wc -l)" -ne 0 ]; then + echo "$commit: KO" + retval=1 + else + echo "$commit: OK" + fi + done; + if [ "$retval" -ne 0 ]; then + echo "Some raw issue references were found (eg. #4242)." + echo "You shall rewrite the faulty commit message with this format: Rust-GCC/gccrs#4242" + echo "You may ignore this CI step if it represents a valid GCC bugzilla or external repository reference instead." + fi + exit $retval; |