Skip to content

Commit

Permalink
added semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmalane committed Apr 28, 2023
1 parent 7b6dd33 commit b94a017
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/schedule-monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Schedule Monthly

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

jobs:
list-inactive-members:
Expand All @@ -17,9 +17,9 @@ jobs:
with:
github-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
script: |
const script = require('./github-actions/trigger-schedule/list-inactive-members/get-list.js')
const getList = script({g: github, c: context})
return getList
const script = require('./github-actions/trigger-schedule/list-inactive-members/get-list.js');
const getList = script({g: github, c: context});
return getList;
# creates a new issue in hackforla/website repo with the list populated above. creates a project card linking to this issue
- name: Create New Issue
Expand All @@ -28,10 +28,10 @@ jobs:
with:
github-token: ${{ secrets.HACKFORLA_BOT_PA_TOKEN }}
script: |
const script = require('./github-actions/trigger-schedule/list-inactive-members/create-new-issue.js')
const list = ${{ steps.get-list.outputs.result }}
const createNewIssue = script({g: github, c: context}, list)
return createNewIssue
const script = require('./github-actions/trigger-schedule/list-inactive-members/create-new-issue.js');
const list = ${{ steps.get-list.outputs.result }};
const createNewIssue = script({g: github, c: context}, list);
return createNewIssue;
# comments on issue #2607, notifying leads that the above issue has been created
- name: Comment Issue
Expand All @@ -40,6 +40,6 @@ jobs:
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)
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);
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function main({ g, c }, newIssueNumber) {
github = g;
context = c;

let agendaAndNotesIssueNumber = 2607
let agendaAndNotesIssueNumber = 2607;
await commentOnIssue(agendaAndNotesIssueNumber, newIssueNumber);
}

Expand Down
36 changes: 18 additions & 18 deletions github-actions/trigger-schedule/list-inactive-members/get-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ async function main({ g, c }) {
let pageNumbers = await getNumberOfPages(org, teamSlug, github);
let allTeamMembers = await getAllMembers(org, teamSlug, pageNumbers);

return await selectMembersWithNoIssues(allTeamMembers, owner, repo)
return await selectMembersWithNoIssues(allTeamMembers, owner, repo);
}

const getNumberOfPages= async (org, teamSlug) => {
const getNumberOfPages = async (org, teamSlug) => {
// get number of pages, needed for `getMembersWithoutIssues` function. GithubAPI has a return limit of 100 results => over 300 team members in website-write
let websiteWriteTeam = await github.rest.teams.getByName({
org,
Expand All @@ -45,25 +45,25 @@ const getAllMembers = async (org, teamSlug, pageNumbers) => {
});
allTeamMembers = allTeamMembers.concat(teamMembers.data);
}
return allTeamMembers
return allTeamMembers;
};

const selectMembersWithNoIssues = async (allTeamMembers, owner, repo) => {
// select team members without open issues
let inactiveMembers = [];
for (let member of allTeamMembers) {
let assignee = member.login;
let memberIssues = await github.rest.issues.listForRepo({
owner,
repo,
state: "open",
assignee,
});
if (memberIssues.data.length === 0) {
inactiveMembers.push(assignee);
}
// select team members without open issues
let inactiveMembers = [];
for (let member of allTeamMembers) {
let assignee = member.login;
let memberIssues = await github.rest.issues.listForRepo({
owner,
repo,
state: "open",
assignee,
});
if (memberIssues.data.length === 0) {
inactiveMembers.push(assignee);
}
return inactiveMembers
}
}
return inactiveMembers;
};

module.exports = main;

0 comments on commit b94a017

Please sign in to comment.