Skip to content

Monthly contributor report #2

Monthly contributor report

Monthly contributor report #2

Workflow file for this run

name: Monthly contributor report
on:
schedule:
- cron: "3 2 1 * *"
workflow_dispatch:
# push:
# branches: ["gh-pages"]
permissions:
issues: write
contents: write
pull-requests: write
jobs:
contributor_report_readme:
name: contributor report
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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: BlackPythonDevs
SPONSOR_INFO: "true"
- name: Create issue
id: ciff
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly contributor report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./contributors.md
labels: |
report
automated issue
# assignees: <YOUR_GITHUB_HANDLE_HERE>
- name: Close Issue
run: gh issue close --comment "Auto-closing issue" ${{ steps.ciff.outputs.issue-number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Contribute List
uses: akhilmhdh/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}