From fb9b3e2d04886a435caca6e77d92717598c1d8fc Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 19 Oct 2023 13:53:05 -0700 Subject: [PATCH] Create thank_contributors.yaml (#4775) * Create thank_contributors.yaml * Update thank_contributors.yaml --- .github/workflows/thank_contributors.yaml | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/thank_contributors.yaml diff --git a/.github/workflows/thank_contributors.yaml b/.github/workflows/thank_contributors.yaml new file mode 100644 index 00000000..e94d7aed --- /dev/null +++ b/.github/workflows/thank_contributors.yaml @@ -0,0 +1,43 @@ +name: Monthly contributor report +on: + workflow_dispatch: + schedule: + - cron: '3 2 1 * *' + +permissions: + issues: write + +jobs: + contributor_report: + name: contributor report + runs-on: ubuntu-latest + + steps: + + - name: Get dates for last month + shell: bash + run: | + # Calculate the first day of the previous month + start_date=$(date -d "last month" +%Y-%m-01) + + # Calculate the last day of the previous month + end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d) + + #Set an environment variable with the date range + echo "START_DATE=$start_date" >> "$GITHUB_ENV" + echo "END_DATE=$end_date" >> "$GITHUB_ENV" + + - name: Run contributor action + uses: github/contributors@v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + START_DATE: ${{ env.START_DATE }} + END_DATE: ${{ env.END_DATE }} + REPOSITORY: super-linter/super-linter + + - name: Create issue + uses: peter-evans/create-issue-from-file@v4 + with: + title: Thank you super-linter contributors (${{ env.START_DATE }}..${{ env.END_DATE }}) + token: ${{ secrets.GITHUB_TOKEN }} + content-filepath: ./contributors.md