Skip to content

Commit

Permalink
ci: sort and add checks for cla signers file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ederst authored Feb 9, 2023
1 parent b3978cb commit b923a1c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tools/.github-cla-signers
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ lucendio
lungj
magnetikonline
mal
ManassehZhou
mamercad
ManassehZhou
manuelisimo
MarkMielke
marlluslustosa
Expand Down Expand Up @@ -105,7 +105,6 @@ rmhsawyer
rongz609
s-makin
SadeghHayeri
SRv6d
sarahwzadara
sbraz
scorpion44
Expand All @@ -115,6 +114,7 @@ shi2wei3
slingamn
slyon
smoser
SRv6d
sshedi
sstallion
stappersg
Expand Down
14 changes: 14 additions & 0 deletions tools/check-cla-signers
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b923a1c

Please sign in to comment.