Skip to content

Commit cb01975

Browse files
authored
Merge pull request #35 from MisRob/community-automations-updates
Final '25 community-related automations package
2 parents c0f9ee2 + 9b8579a commit cb01975

34 files changed

+1829
-561
lines changed

.eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var ERROR = 2;
2+
3+
module.exports = {
4+
env: {
5+
es6: true,
6+
browser: true,
7+
node: true,
8+
},
9+
parserOptions: {
10+
sourceType: 'module',
11+
ecmaVersion: 2020,
12+
ecmaFeatures: {
13+
impliedStrict: true,
14+
},
15+
},
16+
extends: ['eslint:recommended'],
17+
rules: {
18+
'comma-style': ERROR,
19+
'no-console': ERROR,
20+
'max-len': [
21+
ERROR,
22+
100,
23+
{
24+
ignoreStrings: true,
25+
ignoreTemplateLiterals: true,
26+
ignoreUrls: true,
27+
ignoreTrailingComments: true,
28+
},
29+
],
30+
},
31+
};

.github/ISSUE_TEMPLATE/epic_issue.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ assignees: ''
99

1010
_[General guidance: When drafting a feature project, the goal is to create a reference for project scope and context. Write for our core product team. The issue should not be overly technical, and should be be comprehensible and a useful reference to devs, designers, and QA team, to build a shared source of understanding. Anyone at LE should be able to read this and more or less understand the project. If there is relevant information or context that is for the internal team only, please add that in a notion page and link it, rather than adding directly to these issues.]_
1111

12-
## Overview
12+
## Overview
1313

1414
_[First, the project and purpose in one sentence, i.e.: Allow coaches and admins to customize quiz questions in Koilbri]_
1515

@@ -18,23 +18,23 @@ _[Then, more detail]_
1818
- Why are we doing this now?
1919
- What feedback, requests, insights and/or concerns are shaping this feature? Include specific comments from partners, clearinghouse, or teammates as relevant.
2020

21-
### Contributors
22-
_[Fill this out as people are assigned]_
21+
### Contributors
22+
_[Fill this out as people are assigned]_
2323
- Technical lead: [github handle]
24-
- Individual contributors: [list all github handles]
25-
- Designer: [if a specific designer is leading]
24+
- Individual contributors: [list all github handles]
25+
- Designer: [if a specific designer is leading]
2626
- Other relevant LE team members: [optional, i.e. imps point person]
2727

2828
### Goals
2929
- Who is this feature for? Outline user stories below, but also mention if there is a specific partner and/or deployment
3030
- How do we know this feature is successful?
3131

3232
#### User Stories or Requirements
33-
_[Break down the main workflows thematically, but still at a high level. How are the goals of the project realized in the UI? If there isn't a UI portion of this project, what are the key outcomes or improvements? There should probably only be a few of these per project]_
33+
_[Break down the main workflows thematically, but still at a high level. How are the goals of the project realized in the UI? If there isn't a UI portion of this project, what are the key outcomes or improvements? There should probably only be a few of these per project]_
3434

3535
### Target Quarter and Due date
3636
- What is the timeline of this project?
3737
- If there is a specific due date, especially for a contractual deliverable, include it. Otherwise, include an estimated delivery date, and what quarter(s) this will be worked on
3838

39-
### Product Issues
39+
### Product Issues
4040
_[Issues should be linked here as they are created. There will probably be 1-2 per User Story]_

.github/workflows/call-contributor-issue-comment.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Handle contributor comment on GitHub issue
2-
32
on:
43
issue_comment:
54
types: [created]
6-
75
jobs:
86
call-workflow:
97
uses: learningequality/.github/.github/workflows/contributor-issue-comment.yml@main
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Send reply on a new contributor pull request
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
jobs:
6+
call-workflow:
7+
name: Call shared workflow
8+
uses: learningequality/.github/.github/workflows/contributor-pr-reply.yml@main
9+
secrets:
10+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
11+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
12+
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Post holiday message on pull request or issue comment
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
issue_comment:
6+
types: [created]
7+
jobs:
8+
call-workflow:
9+
name: Call shared workflow
10+
uses: learningequality/.github/.github/workflows/holiday-message.yml@main
11+
secrets:
12+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
13+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
14+
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: Manage issue header
2-
32
on:
43
issues:
54
types: [opened, reopened, labeled, unlabeled]
6-
75
jobs:
86
call-workflow:
97
name: Call shared workflow
108
uses: learningequality/.github/.github/workflows/manage-issue-header.yml@main
119
secrets:
12-
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
13-
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
10+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
11+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Update community pull requests spreadsheet
2+
on:
3+
pull_request_target:
4+
types: [assigned, unassigned, opened, closed, reopened, edited, review_requested, review_request_removed]
5+
jobs:
6+
call-workflow:
7+
name: Call shared workflow
8+
uses: learningequality/.github/.github/workflows/update-pr-spreadsheet.yml@main
9+
secrets:
10+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
11+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
12+
CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }}
13+
CONTRIBUTIONS_SHEET_NAME: ${{ secrets.CONTRIBUTIONS_SHEET_NAME }}
14+
GH_UPLOADER_GCP_SA_CREDENTIALS: ${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}
Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,43 @@
11
name: Community Contribution Label
2-
32
on:
4-
workflow_call:
5-
secrets:
6-
LE_BOT_APP_ID:
7-
description: "GitHub App ID for authentication"
8-
required: true
9-
LE_BOT_PRIVATE_KEY:
10-
description: "GitHub App Private Key for authentication"
11-
required: true
3+
workflow_call:
4+
secrets:
5+
LE_BOT_APP_ID:
6+
description: 'GitHub App ID for authentication'
7+
required: true
8+
LE_BOT_PRIVATE_KEY:
9+
description: 'GitHub App Private Key for authentication'
10+
required: true
1211
jobs:
1312
reusable-job:
1413
runs-on: ubuntu-latest
15-
1614
steps:
1715
- name: Check event context
1816
run: |
19-
if [[ "${{ github.event_name }}" != "issues" ]] || [[ "${{ github.event.action }}" != "assigned" && "${{ github.event.action }}" != "unassigned" ]]; then
20-
echo "This workflow should only run on issue assigned/unassigned events"
21-
exit 1
22-
fi
17+
if [[ "${{ github.event_name }}" != "issues" ]] || [[ "${{ github.event.action }}" != "assigned" && "${{ github.event.action }}" != "unassigned" ]]; then
18+
echo "This workflow should only run on issue assigned/unassigned events"
19+
exit 1
20+
fi
2321
- name: Checkout repository
2422
uses: actions/checkout@v4
2523
with:
26-
repository: learningequality/.github
27-
path: .github-repo
28-
24+
repository: learningequality/.github
25+
path: .github-repo
2926
- name: Generate App Token
3027
id: generate-token
3128
uses: tibdex/github-app-token@v2
3229
with:
33-
app_id: ${{ secrets.LE_BOT_APP_ID }}
34-
private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
35-
30+
app_id: ${{ secrets.LE_BOT_APP_ID }}
31+
private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
3632
- name: Set up Python
3733
uses: actions/setup-python@v5
3834
with:
3935
python-version: '3.x'
40-
4136
- name: Install dependencies
4237
run: |
4338
python -m pip install --upgrade pip
4439
pip install requests
45-
4640
- name: Add/Remove Community Contribution Label
4741
run: python .github-repo/scripts/community-contribution-label.py
4842
env:
49-
token: ${{ steps.generate-token.outputs.token }}
43+
token: ${{ steps.generate-token.outputs.token }}
Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,33 @@
11
name: Handle contributor comment on GitHub issue
2-
32
on:
43
workflow_call:
54
secrets:
65
LE_BOT_APP_ID:
7-
description: "GitHub App ID for authentication"
8-
required: true
6+
description: 'GitHub App ID for authentication'
7+
required: true
98
LE_BOT_PRIVATE_KEY:
10-
description: "GitHub App Private Key for authentication"
11-
required: true
9+
description: 'GitHub App Private Key for authentication'
10+
required: true
1211
SLACK_WEBHOOK_URL:
1312
required: true
14-
description: "Webhook URL for Slack #support-dev channel"
13+
description: 'Webhook URL for Slack #support-dev channel'
1514
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL:
1615
required: true
17-
description: "Webhook URL for Slack #support-dev-notifications channel"
18-
19-
16+
description: 'Webhook URL for Slack #support-dev-notifications channel'
2017
jobs:
21-
check-if-close-contributor:
22-
name: Check if user is a close contributor
23-
uses: learningequality/.github/.github/workflows/is-close-contributor.yml@main
18+
check-if-contributor:
19+
name: Check if author is contributor
20+
uses: learningequality/.github/.github/workflows/is-contributor.yml@main
2421
secrets:
25-
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
26-
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
22+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
23+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
2724
with:
2825
username: ${{ github.event.comment.user.login }}
29-
30-
26+
author_association: ${{ github.event.comment.author_association }}
3127
process-issue-comment:
3228
name: Process issue comment
33-
needs: [check-if-close-contributor]
34-
if: >-
35-
${{
36-
!github.event.issue.pull_request &&
37-
github.event.comment.author_association != 'OWNER' &&
38-
github.event.comment.user.login != 'sentry-io[bot]' &&
39-
github.event.comment.user.login != 'learning-equality-bot[bot]' &&
40-
(github.event.comment.author_association != 'MEMBER' || needs.check-if-close-contributor.outputs.is_close_contributor == 'true')
41-
}}
42-
29+
needs: [check-if-contributor]
30+
if: ${{ !github.event.issue.pull_request && github.event.issue.state == 'open' && needs.check-if-contributor.outputs.is_contributor == 'true' }}
4331
runs-on: ubuntu-latest
4432
steps:
4533
- name: Generate App Token
@@ -48,63 +36,53 @@ jobs:
4836
with:
4937
app_id: ${{ secrets.LE_BOT_APP_ID }}
5038
private_key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
51-
5239
- name: Checkout .github repository
5340
uses: actions/checkout@v4
5441
with:
5542
repository: learningequality/.github
5643
ref: main
5744
token: ${{ steps.generate-token.outputs.token }}
58-
5945
- name: Setup Node.js
6046
uses: actions/setup-node@v4
6147
with:
6248
node-version: '20'
63-
6449
- name: Install dependencies
6550
run: yarn install --frozen-lockfile
66-
6751
- name: Run script
6852
id: script
69-
uses: actions/github-script@v7
53+
uses: actions/github-script@v7
7054
with:
7155
github-token: ${{ steps.generate-token.outputs.token }}
7256
script: |
73-
const script = require('./scripts/contributor-issue-comment.js');
74-
return await script({github, context, core});
75-
env:
76-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
77-
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
78-
IS_CLOSE_CONTRIBUTOR: ${{ needs.check-if-close-contributor.outputs.is_close_contributor }}
79-
80-
- name: Send Slack notification about GitHub comment
57+
const script = require('./scripts/contributor-issue-comment.js');
58+
return await script({ github, context, core });
59+
- name: Send Slack notification to support-dev channel
60+
if: ${{ steps.script.outputs.support_dev_message }}
8161
uses: slackapi/[email protected]
8262
with:
8363
webhook-type: incoming-webhook
84-
webhook: ${{ steps.script.outputs.webhook_url }}
85-
payload: >
64+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
65+
payload: |
8666
{
87-
"text": "${{ steps.script.outputs.slack_notification_comment }}"
67+
"text": "${{ steps.script.outputs.support_dev_message }}"
8868
}
89-
90-
- name: Send Slack notification about GitHub bot reply
91-
if: ${{ steps.script.outputs.bot_replied }}
69+
- name: Send Slack notification to support-dev-notifications channel about comment
70+
if: ${{ steps.script.outputs.support_dev_notifications_message }}
9271
uses: slackapi/[email protected]
9372
with:
9473
webhook-type: incoming-webhook
95-
webhook: ${{ steps.script.outputs.webhook_url }}
96-
payload: >
74+
webhook: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
75+
payload: |
9776
{
98-
"text": "${{ steps.script.outputs.slack_notification_bot_comment }}"
77+
"text": "${{ steps.script.outputs.support_dev_notifications_message }}"
9978
}
100-
101-
- name: Send Slack notification about skipped GitHub bot reply
102-
if: ${{ steps.script.outputs.bot_reply_skipped }}
79+
- name: Send Slack notification to support-dev-notifications channel about bot action
80+
if: ${{ steps.script.outputs.support_dev_notifications_bot }}
10381
uses: slackapi/[email protected]
10482
with:
10583
webhook-type: incoming-webhook
106-
webhook: ${{ steps.script.outputs.webhook_url }}
107-
payload: >
84+
webhook: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
85+
payload: |
10886
{
109-
"text": "${{ steps.script.outputs.slack_notification_bot_skipped }}"
87+
"text": "${{ steps.script.outputs.support_dev_notifications_bot }}"
11088
}

0 commit comments

Comments
 (0)