Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add monthly contributor report #5512

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Monthly contributor report
on:
workflow_dispatch:
schedule:
- cron: '3 2 9 * *'

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 }}
ORGANIZATION: ddev
SPONSOR_INFO: "true"

- name: Create issue
uses: peter-evans/create-issue-from-file@v4
with:
title: Monthly contributor report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./contributors.md
assignees: rfay