Repository navigation
52 lines (44 loc) · 2.05 KB
/
Copy pathcontributors.yml
File metadata and controls
52 lines (44 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Monthly contributor reports
on:
workflow_dispatch:
schedule:
- cron: "3 2 1 * *"
permissions: {}
jobs:
contributor_report:
name: contributor reports
runs-on: ubuntu-latest
permissions:
discussions: write # Create the monthly thank-you discussion via abirismyname/create-discussion
steps:
- uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1
with:
egress-policy: audit
- 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-community-projects/contributors@e1118bad7bd389d10b53b363142a11245cbaa9f8 # v2.0.19
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
START_DATE: ${{ env.START_DATE }}
END_DATE: ${{ env.END_DATE }}
REPOSITORY: "github/explore,github/opensource.guide,github/go-spdx,github-community-projects/internal-contribution-forks,github-community-projects/stale-repos,github-community-projects/evergreen,github-community-projects/issue-metrics,github/github-ospo,github-community-projects/contributors,github/automatic-contrib-prs,github-community-projects/cleanowners,github-community-projects/measure-innersource"
SPONSOR_INFO: "true"
LINK_TO_PROFILE: "true"
- name: Create GitHub Discussion
uses: abirismyname/create-discussion@c2b7c825241769dda523865ae444a879f6bbd0e0 # v2.1.0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "Thank you Contributors!"
body-filepath: ./contributors.md
repository-id: "R_kgDOJDwwMQ"
category-id: "DIC_kwDOJDwwMc4CUmf8"