Skip to content

Schedule Monthly

Schedule Monthly #4

name: Schedule Monthly
# This action runs at 11:00 UTC/ 4:00 PDT on the first day of every month except January and August.
on:
schedule:
- cron: 0 11 1 2-7,9-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]>