diff --git a/Makefile b/Makefile index fef6e03f8a..4f73e632d0 100644 --- a/Makefile +++ b/Makefile @@ -192,6 +192,10 @@ gen/test-tls: -subj "/CN=localhost" \ -config pkg/rpc/testdata/tls.config +.PHONY: gen/contributions +gen/contributions: + ./hack/gen-contributions.sh + .PHONY: release release: release/init release/docs diff --git a/README.md b/README.md index 14423d938f..10fd6821ca 100644 --- a/README.md +++ b/README.md @@ -79,31 +79,34 @@ We'd love you to join us! Please see the [Contributor Guide](https://pipecd.dev/ - - + + + + - - - + + + - - - - - - - + + + + + + - + + + - + - - - + + + diff --git a/hack/gen-contributions.sh b/hack/gen-contributions.sh new file mode 100755 index 0000000000..bd9985b736 --- /dev/null +++ b/hack/gen-contributions.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Copyright 2022 The PipeCD Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "Updating the contributors list on README.md ..." + +LINE_NUM=$(($(grep -Fn "### Thanks to the contributors of PipeCD" README.md | cut -f1 -d ':')+1)) +head -n $LINE_NUM README.md >> README.md.tmp + +while read -r line +do + cat <> README.md.tmp +$line +EOT +done < <(gh api -XGET /repos/pipe-cd/pipecd/contributors -F per_page=100 | jq -r '.[] | ""') + +mv README.md.tmp README.md + +echo "Successfully update the contributions list on README.md"