forked from hackforla/website
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 2.1 KB
/
schedule-monthly.yml
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
53
54
55
56
name: Schedule Monthly
# This action runs at 11:00 UTC/ 4:00 PDT on the first day of every month except January.
on:
schedule:
- cron: 0 11 1 2-12 *
jobs:
Trim_Contributors:
runs-on: ubuntu-latest
if: github.repository == 'hackforla/website'
steps:
# Checkout repo, and provide authorization token for `stefanzweifel/git-auto-commit-action` below
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.HACKFORLA_ADMIN_TOKEN }}
# Checks member activity logs for recent and previous contributors
- name: Get Contributors
id: get-contributors
uses: actions/github-script@v7
with:
github-token: ${{ secrets.HACKFORLA_ADMIN_TOKEN }}
script: |
const script = require('./github-actions/trigger-schedule/list-inactive-members/get-contributors-data.js')
const results = script({ g: github, c: context })
return results
# Trims inactive members from team and notifies idle members
- name: Trim and Notify Members
id: trim-and-notify-members
uses: actions/github-script@v7
with:
github-token: ${{ secrets.HACKFORLA_ADMIN_TOKEN }}
script: |
const results = ${{ steps.get-contributors.outputs.result }}
const script = require('./github-actions/trigger-schedule/list-inactive-members/trim-inactive-members.js')
script({ g: github, c: context }, results)
# Run `git pull` so that branch is current prior to next step
- name: Pull latest changes from gh-pages
run: git pull
# Commits list of inactive members to repo for using in next step, and in one month
- name: Update Inactive Members JSON
id: update-inactive-members-json
uses: stefanzweifel/[email protected]
with:
# Glob pattern of file which should be added to the commit
file_pattern: github-actions/utils/_data/inactive-members.json
# Optional commit message and author settings
commit_message: Update Inactive Members JSON
commit_author: GitHub Actions Bot <[email protected]>