Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug and consolidate "Schedule Thursday" into "Schedule Monthly" 4788 #5467

Merged
merged 37 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a36c11d
Update schedule-monthly.yml
t-will-gillis Sep 9, 2023
6354f0c
Update contributors-data.js
t-will-gillis Sep 9, 2023
fa8230e
Update create-new-issue.js
t-will-gillis Sep 9, 2023
62afa80
Update comment-issue.js
t-will-gillis Sep 9, 2023
35d92d1
Update create-new-issue.js
t-will-gillis Sep 9, 2023
14fe8d7
Delete github-actions/trigger-schedule/list-inactive-members/get-list.js
t-will-gillis Sep 9, 2023
d224138
Delete .github/workflows/schedule-monthly-PREV.yml
t-will-gillis Sep 9, 2023
f703c75
Update create-new-issue.js
t-will-gillis Sep 12, 2023
0d5ace4
Update create-new-issue.js
t-will-gillis Sep 22, 2023
e72113d
Update create-new-issue.js
t-will-gillis Oct 22, 2023
96cbc39
Update schedule-monthly.yml
t-will-gillis Oct 30, 2023
158a553
Update contributors-data.js
t-will-gillis Oct 30, 2023
a958b05
Update create-new-issue.js
t-will-gillis Oct 30, 2023
e6e9896
Update create-new-issue.js
t-will-gillis Nov 2, 2023
bdf2661
Create schedule-monthly-PREV.yml
t-will-gillis Nov 13, 2023
35c28c6
Delete .github/workflows/schedule-monthly-PREV.yml
t-will-gillis Nov 13, 2023
b3c65a8
Create schedule-monthly-PREV.yml
t-will-gillis Nov 13, 2023
aac81dc
Update create-new-issue.js
t-will-gillis Nov 22, 2023
1329b56
Update contributors-data.js
t-will-gillis Nov 22, 2023
603e95b
Update contributors-data.js
t-will-gillis Nov 22, 2023
c349364
Update schedule-monthly.yml
t-will-gillis Nov 22, 2023
9e63e0e
Create wr-schedule-monthly.yml
t-will-gillis Nov 23, 2023
1a1329f
Update create-new-issue.js
t-will-gillis Nov 23, 2023
f4f0b03
Create schedule-monthly-reopen.yml
t-will-gillis Nov 23, 2023
2ad2ad2
Update schedule-monthly-PREV.yml
t-will-gillis Nov 23, 2023
fe5ef55
Update schedule-monthly.yml
t-will-gillis Nov 24, 2023
9b8b853
Update contributors-data.js
t-will-gillis Nov 24, 2023
8d005d4
Update wr-schedule-monthly.yml
t-will-gillis Nov 27, 2023
2641e6b
Update schedule-monthly-reopen.yml
t-will-gillis Nov 27, 2023
c3a5f9b
Update issue-trigger.yml
t-will-gillis Nov 29, 2023
f2d3cda
Delete .github/workflows/schedule-monthly-reopen.yml
t-will-gillis Nov 29, 2023
42aac70
Update check-labels.js
t-will-gillis Nov 29, 2023
de7000a
Update create-new-issue.js
t-will-gillis Nov 29, 2023
e9ac3fe
Merge branch 'gh-pages' into fix-sch-monthly-4788
t-will-gillis Nov 29, 2023
afc6a0e
Update create-new-issue.js
t-will-gillis Nov 30, 2023
19006c8
Update contributors-data.js
t-will-gillis Dec 1, 2023
4193a1e
Update create-new-issue.js
t-will-gillis Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/schedule-monthly-PREV.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Schedule Monthly PREVIOUS

on:
schedule:
- cron: "0 8 1 * *"
workflow_dispatch:

jobs:
list-inactive-members:
runs-on: ubuntu-latest
if: github.repository == 'hackforla/website'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# gets a list of website-write team members with no open issues, returns a list of member's github handles
- name: Get List
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/schedule-monthly-reopen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Schedule Monthly- Reopen Issue
on:
issues:
types: [reopened]

jobs:
# Checks to see whether the title of the reopened issue contains the words 'Review Inactive Team Members'
First-Pass:
if: ${{ contains(github.event.issue.title, 'Review Inactive Team Members') }}
runs-on: ubuntu-latest
steps:
- name: Check comment
id: check-comment
uses: actions/github-script@v7
with:
script: |
const issueNumber = ${{ github.event.issue.number }}
console.log("The issue number is: " + issueNumber)
return issueNumber

# Apply the `ready for dev lead` label
- name: Add `ready for dev lead` label
id: add-dev-lead
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ steps.check-comment.outputs.result }},
labels: ['ready for dev lead'],
});
console.log("Add the `ready for dev lead` label.")

# Moves reopened issue to 'Questions/ In Review" column
Move-Reopened-Issue:
needs: First-Pass
runs-on: ubuntu-latest
if: ${{ contains(github.event.issue.title, 'Review Inactive Team Members') }}
steps:
- name: Move Reopened Issue
uses: alex-page/[email protected]
with:
project: Project Board
column: 'Questions / In Review'
repo-token: ${{ secrets.TEST_GHAS }}
64 changes: 59 additions & 5 deletions .github/workflows/schedule-monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ name: Schedule Monthly
on:
schedule:
- cron: 0 11 1 * *
workflow_dispatch:

jobs:
trim_contributors:
Trim_Contributors:
runs-on: ubuntu-latest
if: github.repository == 'hackforla/website'

steps:
# Checkout repo
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}

# Setup node
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
Expand All @@ -29,8 +30,61 @@ jobs:
run: npm install
working-directory: ./github-actions/trigger-schedule/github-data

# Run js file- check action logs for inactive members and removes from 'website-write'
# 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

# Upload artifact file to allow list sharing with next job "Create_New_Issue"
- name: Upload artifact
uses: actions/upload-artifact@v3
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@v3
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
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');
const createNewIssue = script({g: github, c: context}, artifactContent);
return createNewIssue;

# Comments on issue #2607, notifying leads that the above issue has been created
- name: Comment issue
uses: actions/github-script@v7
id: comment-issue
with:
github-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
script: |
const script = require('./github-actions/trigger-schedule/list-inactive-members/comment-issue.js');
const newIssueNumber = ${{ steps.create-new-issue.outputs.result }};
script({g: github, c: context}, newIssueNumber);

46 changes: 46 additions & 0 deletions .github/workflows/wr-schedule-monthly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: WR Schedule Monthly

on:
workflow_run:
workflows: ['Schedule Monthly']
types: [completed]

jobs:
On-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo "The 'Schedule Monthly' workflow succeeded. Continuing."

# If 'Schedule Monthly' was succcesful, retrieve the owner URL
- name: Get owner url
id: get-owner-url
uses: actions/github-script@v7
with:
script: |
const ownerURL = context.payload.repository.html_url;
console.log("Owner url: " + ownerURL);
return ownerURL;

# Then retrieve the latest issue created in the repo (i.e. by 'Schedule Monthly')
- name: Get issue number
id: get-issue-number
uses: actions/github-script@v7
with:
script: |
const newIssue = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state:"all",
per_page: 1,
page: 1,
});
const newIssueNumber = newIssue['data'][0]['number'];
console.log("Latest issue number: " + newIssueNumber);
return newIssueNumber;

# Automatically close this last issue- that is, the issue just created by 'Schedule Monthly'
- name: Auto close issue
run: gh issue close "${{ steps.get-owner-url.outputs.result }}/issues/${{ steps.get-issue-number.outputs.result }}"
env:
GH_TOKEN: ${{ secrets.TEST_GHAS }}
Loading