From b923a1c4fe740e9142d2c16b269d692a69919c0d Mon Sep 17 00:00:00 2001 From: Stefan Prietl Date: Thu, 9 Feb 2023 23:30:56 +0100 Subject: ci: sort and add checks for cla signers file This sorts the CLA signers file and adds a convenience script for users to check and sort the file. A workflow job - which uses the script - makes sure that the file does not get merged in an unsorted state. --- .github/workflows/check_format.yml | 8 ++++++++ CONTRIBUTING.rst | 3 +++ tools/.github-cla-signers | 4 ++-- tools/check-cla-signers | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 tools/check-cla-signers diff --git a/.github/workflows/check_format.yml b/.github/workflows/check_format.yml index 97a41d8e..e6d3c705 100644 --- a/.github/workflows/check_format.yml +++ b/.github/workflows/check_format.yml @@ -92,3 +92,11 @@ jobs: TOXENV: doc run: | tox + + check-cla-signers: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3.0.0 + + - name: Check CLA signers file + run: tools/check-cla-signers diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 31aba9e1..6d4cd65f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -88,6 +88,9 @@ Follow these steps to submit your first pull request to ``cloud-init``: * Note that ``.github-cla-signers`` is sorted alphabetically. + * You may use ``tools/check-cla-signers`` to sort ``.github-cla-signers`` + or check that it is sorted. + * If you already have a change that you want to submit, you can also include the change to ``tools/.github-cla-signers`` in that pull request, there is no need for two separate PRs. diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers index 9c00e9ba..a0458209 100644 --- a/tools/.github-cla-signers +++ b/tools/.github-cla-signers @@ -74,8 +74,8 @@ lucendio lungj magnetikonline mal -ManassehZhou mamercad +ManassehZhou manuelisimo MarkMielke marlluslustosa @@ -105,7 +105,6 @@ rmhsawyer rongz609 s-makin SadeghHayeri -SRv6d sarahwzadara sbraz scorpion44 @@ -115,6 +114,7 @@ shi2wei3 slingamn slyon smoser +SRv6d sshedi sstallion stappersg diff --git a/tools/check-cla-signers b/tools/check-cla-signers new file mode 100755 index 00000000..670158af --- /dev/null +++ b/tools/check-cla-signers @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +CLA_SIGNERS_FILE="tools/.github-cla-signers" + +sort -f "${CLA_SIGNERS_FILE}" -o "${CLA_SIGNERS_FILE}" + +if [[ -n "$(git status --porcelain -- ${CLA_SIGNERS_FILE})" ]]; then + echo "Please make sure that ${CLA_SIGNERS_FILE} is in alphabetical order." + git --no-pager diff "${CLA_SIGNERS_FILE}" + exit 1 +fi -- cgit v1.2.1