From 9b936350b691e5c82e5437a5dec8c8d22cea6dda Mon Sep 17 00:00:00 2001 From: Evgeny Karasik Date: Wed, 23 Aug 2023 12:55:45 +0300 Subject: [PATCH] chore: introduce Contributors file (#26587) This GitHub Action updates a CONTRIBUTORS file with the top contributors from the project, pulling contents from the GitHub API. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .github/workflows/README.md | 5 ++++ .github/workflows/update-contributors.yml | 31 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/update-contributors.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 6a3114f5318bc..c4a166772274e 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -98,3 +98,8 @@ Owner: Core CDK team [repo-metrics.yml](repo-metrics.yml): GitHub action that runs monthly to report on metrics for issues and PRs created last month. Owner: Core CDK team + +### Contributors File + +[update-contributors.yml](update-contributors.yml): GitHub action that runs monthly to create a pull request for updating a CONTRIBUTORS file with the top contributors. +Owner: Core CDK team diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml new file mode 100644 index 0000000000000..82bfc6e88aa21 --- /dev/null +++ b/.github/workflows/update-contributors.yml @@ -0,0 +1,31 @@ + +name: Update CONTRIBUTORS file +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: +jobs: + main: + # this workflow will always fail in forks; bail if this isn't running in the upstream + if: github.repository == 'aws/aws-cdk' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: minicli/action-contributors@v3.3 + name: "Update a projects CONTRIBUTORS file" + env: + CONTRIB_REPOSITORY: 'aws/aws-cdk' + CONTRIB_OUTPUT_FILE: 'CONTRIBUTORS.md' + - name: Create a PR + uses: peter-evans/create-pull-request@v5 + with: + # Git commit details + branch: automation/update-contributors + author: aws-cdk-automation + commit-message: chore: update Contributors File + # Pull Request details + title: 'chore: update Contributors File' + labels: auto-approve + # Github prevents further Github actions to be run if the default Github token is used. + # Instead use a privileged token here, so further GH actions can be triggered on this PR. + token: ${{ secrets.PROJEN_GITHUB_TOKEN }}