summaryrefslogtreecommitdiff
path: root/tools/check-cla-signers
diff options
context:
space:
mode:
authorStefan Prietl <ederst@users.noreply.github.com>2023-02-09 23:30:56 +0100
committerGitHub <noreply@github.com>2023-02-09 15:30:56 -0700
commitb923a1c4fe740e9142d2c16b269d692a69919c0d (patch)
tree7cb40622cc5691a7103305436da263c4d1dddfc8 /tools/check-cla-signers
parentb3978cbd6c68c883f5ab02630d8d7fcb220b270c (diff)
downloadcloud-init-git-b923a1c4fe740e9142d2c16b269d692a69919c0d.tar.gz
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.
Diffstat (limited to 'tools/check-cla-signers')
-rwxr-xr-xtools/check-cla-signers14
1 files changed, 14 insertions, 0 deletions
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