From df5c838aa25eec84ad3b0cf703d8202477ba8e7b Mon Sep 17 00:00:00 2001 From: Pion <59523206+pionbot@users.noreply.github.com> Date: Fri, 2 Jul 2021 02:06:25 +0000 Subject: [PATCH] Update CI configs to v0.5.3 Update lint scripts and CI configs. --- ...rt-contributors.sh => generate-authors.sh} | 29 ++++++----- .github/hooks/pre-push.sh | 2 +- .github/workflows/generate-authors.yml | 48 +++++++++++++++++++ .github/workflows/lint.yaml | 3 -- AUTHORS.txt | 45 +++++++++++++++++ README.md | 38 --------------- 6 files changed, 111 insertions(+), 54 deletions(-) rename .github/{assert-contributors.sh => generate-authors.sh} (58%) create mode 100644 .github/workflows/generate-authors.yml create mode 100644 AUTHORS.txt diff --git a/.github/assert-contributors.sh b/.github/generate-authors.sh similarity index 58% rename from .github/assert-contributors.sh rename to .github/generate-authors.sh index 12e6afe..182e4f5 100755 --- a/.github/assert-contributors.sh +++ b/.github/generate-authors.sh @@ -12,6 +12,7 @@ set -e SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) +AUTHORS_PATH="$GITHUB_WORKSPACE/AUTHORS.txt" if [ -f ${SCRIPT_PATH}/.ci.conf ] then @@ -21,18 +22,18 @@ fi # # DO NOT EDIT THIS # -EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion Bot') +EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion Bot' 'pionbot') # If you want to exclude a name from all repositories, send a PR to # https://github.com/pion/.goassets instead of this repository. # If you want to exclude a name only from this repository, # add EXCLUDED_CONTRIBUTORS=('name') to .github/.ci.conf -MISSING_CONTRIBUTORS=() +CONTRIBUTORS=() shouldBeIncluded () { for i in "${EXCLUDED_CONTRIBUTORS[@]}" do - if [ "$i" == "$1" ] ; then + if [[ $1 =~ "$i" ]]; then return 1 fi done @@ -41,21 +42,25 @@ shouldBeIncluded () { IFS=$'\n' #Only split on newline -for contributor in $(git log --format='%aN' | sort -u) +for contributor in $(git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf) do if shouldBeIncluded $contributor; then - if ! grep -q "$contributor" "$SCRIPT_PATH/../README.md"; then - MISSING_CONTRIBUTORS+=("$contributor") - fi + CONTRIBUTORS+=("$contributor") fi done unset IFS -if [ ${#MISSING_CONTRIBUTORS[@]} -ne 0 ]; then - echo "Please add the following contributors to the README" - for i in "${MISSING_CONTRIBUTORS[@]}" +if [ ${#CONTRIBUTORS[@]} -ne 0 ]; then + cat >$AUTHORS_PATH <<-'EOH' +# Thank you to everyone that made Pion possible. If you are interested in contributing +# we would love to have you https://github.com/pion/webrtc/wiki/Contributing +# +# This file is auto generated, using git to list all individuals contributors. +# see `.github/generate-authors.sh` for the scripting +EOH + for i in "${CONTRIBUTORS[@]}" do - echo "$i" + echo "$i" >> $AUTHORS_PATH done - exit 1 + exit 0 fi diff --git a/.github/hooks/pre-push.sh b/.github/hooks/pre-push.sh index 7cb2365..bfe65bc 100755 --- a/.github/hooks/pre-push.sh +++ b/.github/hooks/pre-push.sh @@ -8,6 +8,6 @@ set -e -.github/assert-contributors.sh +.github/generate-authors.sh exit 0 diff --git a/.github/workflows/generate-authors.yml b/.github/workflows/generate-authors.yml new file mode 100644 index 0000000..a0a7478 --- /dev/null +++ b/.github/workflows/generate-authors.yml @@ -0,0 +1,48 @@ +name: generate-authors + +on: + pull_request: + +jobs: + generate-authors: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + token: ${{ secrets.PIONBOT_PRIVATE_KEY }} + + - name: Generate the authors file + run: .github/generate-authors.sh + + - name: Add the authors file to git + run: git add AUTHORS.txt + + - name: Get last commit message + id: last-commit-message + run: | + COMMIT_MSG=$(git log -1 --pretty=%B) + COMMIT_MSG="${COMMIT_MSG//'%'/'%25'}" + COMMIT_MSG="${COMMIT_MSG//$'\n'/'%0A'}" + COMMIT_MSG="${COMMIT_MSG//$'\r'/'%0D'}" + echo "::set-output name=msg::$COMMIT_MSG" + + - name: Get last commit author + id: last-commit-author + run: | + echo "::set-output name=msg::$(git log -1 --pretty='%aN <%ae>')" + + - name: Check if AUTHORS.txt file has changed + id: git-status-output + run: | + echo "::set-output name=msg::$(git status -s | wc -l)" + + - uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{ steps.git-status-output.outputs.msg != '0' }} + with: + commit_message: ${{ steps.last-commit-message.outputs.msg }} + commit_author: ${{ steps.last-commit-author.outputs.msg }} + commit_options: '--amend --no-edit' + push_options: '--force' + skip_fetch: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8824c34..bc44c3a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,9 +22,6 @@ jobs: - name: File names run: .github/lint-filename.sh - - name: Contributors - run: .github/assert-contributors.sh - - name: Functions run: .github/lint-disallowed-functions-in-library.sh diff --git a/AUTHORS.txt b/AUTHORS.txt new file mode 100644 index 0000000..6a1ddbb --- /dev/null +++ b/AUTHORS.txt @@ -0,0 +1,45 @@ +# Thank you to everyone that made Pion possible. If you are interested in contributing +# we would love to have you https://github.com/pion/webrtc/wiki/Contributing +# +# This file is auto generated, using git to list all individuals contributors. +# see `.github/generate-authors.sh` for the scripting +Aaron France +Adam Kiss +adwpc +Aleksandr Razumov +Antoine Baché +Assad Obaid +Atsushi Watanabe +backkem +buptczq +cgojin +Chao Yuan +David Hamilton +David Zhao +Henry +Hugo Arregui +Hugo Arregui +Jason Maldonis +Jerko Steiner +JooYoung +Juliusz Chroboczek +Konstantin Itskov +korymiller1489 +Kyle Carberry +Lander Noterman +Luke Curley +Michael MacDonald +Michael MacDonald +Nevio Vesic +Ori Bernstein +Robert Eperjesi +Sam Lancia +Sam Lancia +Sean DuBois +Sean DuBois +Sebastian Waisbrot +Sidney San Martín +Will Forcey +Yutaka Takeda +ZHENK +Zizheng Tai diff --git a/README.md b/README.md index 678ae23..8191fc4 100644 --- a/README.md +++ b/README.md @@ -29,43 +29,5 @@ If you need commercial support or don't want to use public methods you can conta ### Contributing Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contributing)** to join the group of amazing people making this project possible: -* [John Bradley](https://github.com/kc5nra) - *Original Author* -* [Sean DuBois](https://github.com/Sean-Der) - *Original Author* -* [Michael MacDonald](https://github.com/mjmac) - *Original Author* -* [Michiel De Backker](https://github.com/backkem) - *Original Author* -* [Konstantin Itskov](https://github.com/trivigy) - *Original Author* -* [Luke Curley](https://github.com/kixelated) -* [Hugo Arregui](https://github.com/hugoArregui) -* [Adam Kiss](https://github.com/masterada) -* [Aleksandr Razumov](https://github.com/ernado) -* [Yutaka Takeda](https://github.com/enobufs) -* [Atsushi Watanabe](https://github.com/at-wat) -* [Robert Eperjesi](https://github.com/epes) -* [Sebastian Waisbrot](https://github.com/seppo0010) -* [Zizheng Tai](https://github.com/ZizhengTai) -* [Aaron France](https://github.com/AeroNotix) -* [Chao Yuan](https://github.com/yuanchao0310) -* [Jason Maldonis](https://github.com/jjmaldonis) -* [Nevio Vesic](https://github.com/0x19) -* [David Hamilton](https://github.com/dihamilton) -* [adwpc](https://github.com/adwpc) -* [Ori Bernstein](https://eigenstate.org) -* [Sam Lancia](https://github.com/nerd2) -* [Lander Noterman](https://github.com/LanderN) -* [BUPTCZQ](https://github.com/buptczq) -* [Henry](https://github.com/cryptix) -* [Jerko Steiner](https://github.com/jeremija) -* [Sidney San Martín](https://github.com/s4y) -* [JooYoung Lim](https://github.com/DevRockstarZ) -* [Kory Miller](https://github.com/korymiller1489) -* [ZHENK](https://github.com/scorpionknifes) -* [Assad Obaid](https://github.com/assadobaid) -* [Antoine Baché](https://github.com/Antonito) -* [Will Forcey](https://github.com/wawesomeNOGUI) -* [David Zhao](https://github.com/davidzhao) -* [Juliusz Chroboczek](https://github.com/jech) -* [Jin Gong](https://github.com/cgojin) -* [Kyle Carberry](https://github.com/kylecarbs) - ### License MIT License - see [LICENSE](LICENSE) for full text