Skip to content

Commit 9e08a22

Browse files
authored
Create contributors.yml
1 parent 94a8bbd commit 9e08a22

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/contributors.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
17+
- name: Get dates for last month
18+
shell: bash
19+
run: |
20+
# Calculate the first day of the previous month
21+
start_date=$(date -d "last month" +%Y-%m-01)
22+
23+
# Calculate the last day of the previous month
24+
end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d)
25+
26+
#Set an environment variable with the date range
27+
echo "START_DATE=$start_date" >> "$GITHUB_ENV"
28+
echo "END_DATE=$end_date" >> "$GITHUB_ENV"
29+
30+
- name: Run contributor action
31+
uses: github/contributors@v1
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
START_DATE: ${{ env.START_DATE }}
35+
END_DATE: ${{ env.END_DATE }}
36+
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"
37+
SPONSOR_INFO: "true"
38+
LINK_TO_PROFILE: "true"
39+
40+
- name: Create GitHub Discussion
41+
uses: abirismyname/[email protected]
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
title: Thank you Contributors!
46+
body-filepath: ./contributors.md
47+
repository-id: R_kgDOJDwwMQ
48+
category-id: DIC_kwDOJDwwMc4CUmf8
49+

0 commit comments

Comments
 (0)