Skip to content

Commit

Permalink
Edit contributors-data.js and associated files 6193 (#6520)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-will-gillis authored Apr 26, 2024
1 parent c3fab70 commit caa4f1b
Show file tree
Hide file tree
Showing 8 changed files with 574 additions and 488 deletions.
75 changes: 32 additions & 43 deletions .github/workflows/schedule-monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,64 +15,53 @@ jobs:
# Checkout repo
- name: Checkout repository
uses: actions/checkout@v4

# Checks member activity logs for recent and previous contributors
- name: Get Contributors
id: get-contributors
uses: actions/github-script@v7
with:
token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}

# Setup node
- name: Setup node
uses: actions/setup-node@v4
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:
node-version: 18
cache: 'npm'

# Install dependencies to run js file
- name: Install npm dependencies
run: npm install
working-directory: ./github-actions/trigger-schedule/github-data
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)
# Commits list of inactive members to repo for using in next step, and in one month
- name: Update Inactive Members JSON
uses: stefanzweifel/git-auto-commit-action@v5.0.0
with:
# Glob pattern of file which should be added to the commit
file_pattern: github-actions/utils/_data/inactive-members.json

# Run js file: checks contributor activity logs, removes two-month inactive members from
# 'website-write' team, then compiles list of one-month inactive members for notification
- name: Trim Members
env:
token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
run: node github-actions/trigger-schedule/github-data/contributors-data.js
# Optional commit message and author settings
commit_message: Update Inactive Members JSON
commit_author: GitHub Actions Bot <hackforla-bot@hackforla.org>

# Upload artifact file to allow list sharing with next job "Create_New_Issue"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: trim_job_artifact
path: inactive-Members.json


Create_New_Issue:
needs: Trim_Contributors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Download artifact file from "Trim_Contributors"
- name: Download artifact
id: download-artifact
uses: actions/download-artifact@v4
with:
name: trim_job_artifact

# Extract and save artifact in usable form for next steps
- name: Extract artifact
id: extract-artifact
run: |
jq -c . inactive-Members.json > out-inactive-Members.json
echo "TRIM_LISTS=$(cat out-inactive-Members.json)" >> $GITHUB_ENV
# Creates a new issue in 'hackforla/website' repo with the saved lists
- name: Create new issue
uses: actions/github-script@v7
id: create-new-issue
uses: actions/github-script@v7
with:
github-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
script: |
const artifactContent = process.env.TRIM_LISTS
const script = require('./github-actions/trigger-schedule/list-inactive-members/create-new-issue.js')
script({g: github, c: context}, artifactContent)
script({g: github, c: context})
Loading

0 comments on commit caa4f1b

Please sign in to comment.