Skip to content

Commit 72b80c2

Browse files
authored
Merge pull request github#91 from github/contributor-reports
Thank contributors monthly via discussions
2 parents 94a8bbd + 6006d15 commit 72b80c2

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/contributors.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Monthly contributor reports
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "3 2 1 * *"
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
contributor_report:
12+
name: contributor reports
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Get dates for last month
17+
shell: bash
18+
run: |
19+
# Calculate the first day of the previous month
20+
start_date=$(date -d "last month" +%Y-%m-01)
21+
22+
# Calculate the last day of the previous month
23+
end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d)
24+
25+
#Set an environment variable with the date range
26+
echo "START_DATE=$start_date" >> "$GITHUB_ENV"
27+
echo "END_DATE=$end_date" >> "$GITHUB_ENV"
28+
29+
- name: Run contributor action
30+
uses: github/contributors@v1
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
START_DATE: ${{ env.START_DATE }}
34+
END_DATE: ${{ env.END_DATE }}
35+
REPOSITORY: "github/go-spdx,github-community-projects/internal-contribution-forks,github/stale-repos,github/evergreen,github/issue-metrics,github/github-ospo,github/contributors,github/automatic-contrib-prs,github/cleanowners"
36+
SPONSOR_INFO: "true"
37+
LINK_TO_PROFILE: "true"
38+
39+
- name: Create GitHub Discussion
40+
uses: abirismyname/[email protected]
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
title: Thank you Contributors!
45+
body-filepath: ./contributors.md
46+
repository-id: R_kgDOJDwwMQ
47+
category-id: DIC_kwDOJDwwMc4CUmf8

0 commit comments

Comments
 (0)