Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions .github/workflows/emeritus-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Emeritus Check

on:
# Run on the 1st of every month at 9:00 AM UTC
schedule:
- cron: "0 9 1 * *"
# Allow manual trigger
workflow_dispatch:

permissions:
# Required to read repository contents
contents: read
# Required to create issues
issues: write

jobs:
emeritus-check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we pin it to shas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, thanks TIL!

with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"

- name: Install dependencies
run: npm i --ignore-scripts

- name: Run emeritus check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node index.js emeritus --monthsInactiveThreshold 12 --org fastify
18 changes: 11 additions & 7 deletions commands/emeritus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,22 @@ export default async function emeritus ({ client, logger }, { org, monthsInactiv
logger.info('[DRY-RUN] These users should be added to emeritus team:')
usersToEmeritus.forEach(user => logger.info(`- @${user.user}`))
} else {
await client.createIssue(
orgData.name,
'org-admin',
'Move to emeritus members',
if (usersToEmeritus.length > 0) {
await client.createIssue(
orgData.name,
'org-admin',
'Move to emeritus members',
`The following users have been inactive for more than ${monthsInactiveThreshold} months
and should be added to the emeritus team to control the access to the Fastify organization:
and should be added to the emeritus team to control the access to the Fastify organization
and secure the organization's repositories:

${usersToEmeritus.map(user => `- @${user.user}`).join('\n')}

\nComment here if you don't want to move them to emeritus team.`,
\nComment here if you don't want to be moved to emeritus team and confirm that your account
is still monitored and secured.`,
['question']
)
)
}
}
}

Expand Down
Loading