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
51 changes: 51 additions & 0 deletions .github/workflows/automation-caller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file is generated by scripts/generate-automation.js from automation-registry.yml.
# Do not edit it by hand - edit the registry and run:
# node scripts/generate-automation.js
#
# This repo's own automation caller - .github acts as consumer zero and stays in sync automatically.

name: Automation
on:
pull_request_target:
types:
- review_requested
- labeled
- opened
- assigned
- unassigned
- closed
- reopened
- edited
- review_request_removed
issue_comment:
types:
- created
issues:
types:
- opened
- reopened
- labeled
- unlabeled
- assigned
- unassigned
pull_request_review_comment:
types:
- created
schedule:
- cron: 1 0 * * 1
workflow_dispatch: {}
permissions:
contents: write
pull-requests: write
jobs:
automation:
name: Run automations
uses: learningequality/.github/.github/workflows/automation.yml@main
secrets:
CONTRIBUTIONS_SHEET_NAME: ${{ secrets.CONTRIBUTIONS_SHEET_NAME }}
CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }}
GH_UPLOADER_GCP_SA_CREDENTIALS: ${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
155 changes: 155 additions & 0 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# This file is generated by scripts/generate-automation.js from automation-registry.yml.
# Do not edit it by hand - edit the registry and run:
# node scripts/generate-automation.js
#
# Reusable workflow: one job per automation, gated on the original triggering event/action.

name: Automation
on:
workflow_call:
secrets:
CONTRIBUTIONS_SHEET_NAME:
description: "Forwarded to: update-pr-spreadsheet"
required: true
CONTRIBUTIONS_SPREADSHEET_ID:
description: "Forwarded to: update-pr-spreadsheet"
required: true
GH_UPLOADER_GCP_SA_CREDENTIALS:
description: "Forwarded to: update-pr-spreadsheet"
required: true
LE_BOT_APP_ID:
description: "Forwarded to: review-requested, pull-request-label, dependabot-reviewer, contributor-pr-reply, holiday-message, issue-open, issue-label-header, good-first-issue-comment, update-pr-spreadsheet, community-contribution-label, contributor-issue-comment, unassign-inactive-issues"
required: true
LE_BOT_PRIVATE_KEY:
description: "Forwarded to: review-requested, pull-request-label, dependabot-reviewer, contributor-pr-reply, holiday-message, issue-open, issue-label-header, good-first-issue-comment, update-pr-spreadsheet, community-contribution-label, contributor-issue-comment, unassign-inactive-issues"
required: true
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL:
description: "Forwarded to: contributor-pr-reply, holiday-message, contributor-issue-comment, unassign-inactive-issues"
required: true
SLACK_WEBHOOK_URL:
description: "Forwarded to: contributor-issue-comment"
required: true
jobs:
review-requested:
name: Review Requested
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'review_requested' }}
uses: learningequality/.github/.github/workflows/review-requested.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
pull-request-label:
name: Pull Request Label
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'labeled' }}
uses: learningequality/.github/.github/workflows/pull-request-label.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
dependabot-reviewer:
name: Dependabot Reviewer
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'opened' && github.event.pull_request.user.login == 'dependabot[bot]' }}
uses: learningequality/.github/.github/workflows/dependabot-reviewer.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
contributor-pr-reply:
name: Contributor Pr Reply
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'opened' }}
uses: learningequality/.github/.github/workflows/contributor-pr-reply.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
holiday-message:
name: Holiday Message
if: ${{ (github.event_name == 'pull_request_target' && github.event.action == 'opened') || (github.event_name == 'issue_comment' && github.event.action == 'created') }}
uses: learningequality/.github/.github/workflows/holiday-message.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
issue-open:
name: Issue Open
if: ${{ github.event_name == 'issues' && contains(fromJSON('["opened","reopened"]'), github.event.action) }}
uses: learningequality/.github/.github/workflows/manage-issue-header.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
issue-label-header:
name: Issue Label Header
if: ${{ github.event_name == 'issues' && contains(fromJSON('["labeled","unlabeled"]'), github.event.action) && github.event.label.name == 'help wanted' }}
uses: learningequality/.github/.github/workflows/manage-issue-header.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
good-first-issue-comment:
name: Good First Issue Comment
if: ${{ github.event_name == 'issues' && github.event.action == 'labeled' && (github.event.label.name == 'good first issue' || github.event.label.name == 'help wanted') }}
uses: learningequality/.github/.github/workflows/good-first-issue-comment.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
update-pr-spreadsheet:
name: Update Pr Spreadsheet
if: ${{ github.event_name == 'pull_request_target' && contains(fromJSON('["assigned","unassigned","opened","closed","reopened","edited","review_requested","review_request_removed"]'), github.event.action) }}
uses: learningequality/.github/.github/workflows/update-pr-spreadsheet.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
CONTRIBUTIONS_SPREADSHEET_ID: ${{ secrets.CONTRIBUTIONS_SPREADSHEET_ID }}
CONTRIBUTIONS_SHEET_NAME: ${{ secrets.CONTRIBUTIONS_SHEET_NAME }}
GH_UPLOADER_GCP_SA_CREDENTIALS: ${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}
community-contribution-label:
name: Community Contribution Label
if: ${{ github.event_name == 'issues' && contains(fromJSON('["assigned","unassigned"]'), github.event.action) }}
uses: learningequality/.github/.github/workflows/community-contribution-label.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
contributor-issue-comment:
name: Contributor Issue Comment
if: ${{ github.event_name == 'issue_comment' && github.event.action == 'created' }}
uses: learningequality/.github/.github/workflows/contributor-issue-comment.yml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
resolve-bot-pr-threads:
name: Resolve Bot Pr Threads
if: ${{ github.event_name == 'pull_request_review_comment' }}
uses: learningequality/.github/.github/workflows/resolve_bot_pr_threads.yml@main
permissions:
contents: write
pull-requests: write
unassign-inactive-issues:
name: Unassign Inactive Issues
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
uses: learningequality/.github/.github/workflows/unassign-inactive-issues.yaml@main
permissions:
contents: read
secrets:
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL: ${{ secrets.SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL }}
12 changes: 0 additions & 12 deletions .github/workflows/call-contributor-issue-comment.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/call-contributor-pr-reply.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/call-holiday-message.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/call-issue-label.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/call-issue-open.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/call-pull-request-target.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/call-update-pr-spreadsheet.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Linting
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
pre-commit:
name: Run prek
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install prek
run: pipx install prek
- name: Run prek
run: prek run --all-files
32 changes: 0 additions & 32 deletions .github/workflows/pull-request-target.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@ repos:
rev: v0.14.0
hooks:
- id: yamlfmt
exclude: '^tests/cassettes'
exclude: '^tests/cassettes|^\.github/workflows/automation(-caller)?\.yml$|^automation-template\.yml$'
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
# Expects shellcheck to be installed on the system
# https://github.com/koalaman/shellcheck#installing
- repo: local
hooks:
- id: generate-automation
name: Check automation.yml / automation-template.yml are up to date
entry: node scripts/generate-automation.js --check
language: system
files: '^(automation-registry\.yml|\.github/workflows/automation(-caller)?\.yml|automation-template\.yml)$'
pass_filenames: false
Loading
Loading