Skip to content
Merged
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
15 changes: 12 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Automatically update versions for pip

version: 2
updates:
# Maintain dependencies for Node
Expand All @@ -11,7 +9,7 @@ updates:
cooldown:
default-days: 7
# Maintain dependencies for Python
- package-ecosystem: 'pip'
- package-ecosystem: 'uv'
directory: '/'
schedule:
interval: 'monthly'
Expand All @@ -30,3 +28,14 @@ updates:
github:
patterns:
- 'actions/*'
- package-ecosystem: 'pre-commit'
directory: '/'
schedule:
interval: 'monthly'
time: '00:00'
cooldown:
default-days: 7
groups:
pre-commit:
patterns:
- '*'
17 changes: 8 additions & 9 deletions .github/workflows/community-contribution-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check event context
env:
EVENT_NAME: ${{ github.event_name }}
EVENT_ACTION: ${{ github.event.action }}
run: |
if [[ "${{ github.event_name }}" != "issues" ]] || [[ "${{ github.event.action }}" != "assigned" && "${{ github.event.action }}" != "unassigned" ]]; then
if [[ "$EVENT_NAME" != "issues" ]] || [[ "$EVENT_ACTION" != "assigned" && "$EVENT_ACTION" != "unassigned" ]]; then
echo "This workflow should only run on issue assigned/unassigned events"
exit 1
fi
Expand All @@ -29,15 +32,11 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
- name: Set up Python
uses: actions/setup-python@v7
permission-issues: write
- uses: astral-sh/setup-uv@v10.3.2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
enable-cache: false
- name: Add/Remove Community Contribution Label
run: python .github-repo/scripts/community-contribution-label.py
run: uv run --project .github-repo --no-dev --locked .github-repo/scripts/community-contribution-label.py
env:
token: ${{ steps.generate-token.outputs.token }}
5 changes: 4 additions & 1 deletion .github/workflows/contributor-issue-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL:
required: true
description: 'Webhook URL for Slack #support-dev-notifications channel'
permissions:
contents: read
jobs:
check-if-contributor:
name: Check if author is contributor
Expand All @@ -36,12 +38,13 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-issues: write
permission-pull-requests: read
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/contributor-pr-reply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL:
required: true
description: 'Webhook URL for Slack #support-dev-notifications channel'
permissions:
contents: read
jobs:
check-if-contributor:
name: Check if author is contributor
Expand All @@ -33,12 +35,13 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-issues: read
permission-pull-requests: write
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dependabot-reviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-pull-requests: write
- name: Request review
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
GH_REPO: ${{ github.repository }}
run: gh pr edit ${{ github.event.pull_request.number }} --add-reviewer ${{ inputs.reviewer }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REVIEWER: ${{ inputs.reviewer }}
run: gh pr edit "$PR_NUMBER" --add-reviewer "$REVIEWER"
2 changes: 1 addition & 1 deletion .github/workflows/good-first-issue-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-issues: write
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/holiday-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
SLACK_COMMUNITY_NOTIFICATIONS_WEBHOOK_URL:
required: true
description: 'Webhook URL for Slack #support-dev-notifications channel'
permissions:
contents: read
jobs:
check-if-contributor:
name: Check if author is contributor
Expand All @@ -33,12 +35,13 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-issues: write
permission-pull-requests: write
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/is-contributor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-metadata: read
- name: Checkout .github repository
uses: actions/checkout@v7
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manage-issue-header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-issues: write
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr-statistics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- cron: '0 8 * * 1'
workflow_dispatch:
# Allow manual triggering for testing
permissions:
contents: read
jobs:
generate-pr-statistics:
runs-on: ubuntu-latest
Expand All @@ -16,12 +18,12 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-pull-requests: read
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@ jobs:
uses: actions/setup-node@v7
with:
node-version: '20'
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install prek
run: pipx install prek
- uses: astral-sh/setup-uv@v10.3.2
with:
enable-cache: true
cache-python: true
- name: Install and verify lock
run: uv sync --group dev --locked
- uses: actions/cache@v6
with:
path: ~/.cache/prek
key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run prek
run: prek run --all-files
run: uv run prek run --all-files --show-diff-on-failure
4 changes: 3 additions & 1 deletion .github/workflows/pull-request-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
LE_BOT_PRIVATE_KEY:
description: 'GitHub App Private Key for authentication'
required: true
permissions:
contents: read
jobs:
check-if-contributor:
name: Check if author is contributor
Expand All @@ -30,12 +32,12 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-pull-requests: write
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-contents: read
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/review-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
LE_BOT_PRIVATE_KEY:
description: 'GitHub App Private Key for authentication'
required: true
permissions:
contents: read
jobs:
check-if-contributor:
name: Check if author is contributor
Expand All @@ -30,12 +32,12 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-pull-requests: write
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/sync-automation-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
owner: learningequality
owner: learningequality # zizmor: ignore[github-app]
permission-contents: write
permission-pull-requests: write
permission-workflows: write
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unassign-inactive-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-issues: write
permission-members: read
permission-pull-requests: read
- name: Checkout .github repository
uses: actions/checkout@v7
with:
repository: learningequality/.github
ref: main
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-pr-spreadsheet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
with:
app-id: ${{ secrets.LE_BOT_APP_ID }}
private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }}
permission-pull-requests: read
- name: Checkout .github repository
uses: actions/checkout@v7
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rules:
unpinned-uses:
config:
policies:
'*': ref-pin
31 changes: 28 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -9,19 +9,44 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
exclude: '^.+?\.json$'
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.13.5
hooks:
- id: uv-lock
- repo: https://github.com/google/yamlfmt
rev: v0.14.0
rev: v0.21.0
hooks:
- id: yamlfmt
exclude: '^tests/cassettes|^\.github/workflows/automation(-caller|-group-.+)?\.yml$|^automation-template\.yml$'
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
rev: v1.7.12
hooks:
- id: actionlint
# Expects shellcheck to be installed on the system
# https://github.com/koalaman/shellcheck#installing
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.31.1
hooks:
- id: zizmor
args: [--no-progress, --offline, --min-confidence, medium]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.2
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: eslint
name: ESLint
entry: yarn eslint --fix
language: system
files: \.js$
- id: prettier
name: Prettier
entry: yarn prettier --write
language: system
files: \.js$
- id: generate-automation
name: Check automation.yml / automation-template.yml are up to date
entry: node scripts/generate-automation.js --check
Expand Down
Loading
Loading