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
4 changes: 4 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ knowledge_base:
reviews:
path_filters:
- .github/actions/**
- .github/CODEOWNERS
- .github/README.md
- .github/renovate.json5
- .github/workflows/**
- .trunk/**
- .coderabbit.yaml
24 changes: 12 additions & 12 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Require review from repository maintainers team
/.editorconfig @3ware/repo-maintainers
/.github/actions/** @3ware/repo-maintainers
/.github/CODEOWNERS @3ware/repo-maintainers
/.github/README.md @3ware/repo-maintainers
/.github/release-please-config.json @3ware/repo-maintainers
/.github/release-please-manifest.json @3ware/repo-maintainers
/.github/renovate.json @3ware/repo-maintainers
/.github/workflows/reusable-trunk-code-quality.yaml @3ware/repo-maintainers
/.github/workflows/reusable-validate-pr-title.yaml @3ware/repo-maintainers
/.vscode/** @3ware/repo-maintainers
/CHANGELOG.md @3ware/repo-maintainers
# Require review from repository maintainers for everything by default.
* @3ware/repo-maintainers

# Files below have no owner so pr-check can auto-approve them. Keep in sync with the
# path-filters input of the Auto approve step in .github/workflows/pr-check.yaml
/.github/gh-actions-lock.version
/.github/workflows/actions-lockfile-check.yaml
/.github/workflows/lint.yaml
/.github/workflows/release.yaml
/.github/workflows/scheduled.yaml
/.github/workflows/trunk-upgrade.yaml
/.trunk/trunk.yaml
10 changes: 10 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ This repository publishes reusable GitHub Actions workflows and composite action
- Use conventional pull request titles. They become the squashed commit message and are used by release-please to determine release notes and version bumps.
- Follow `.editorconfig` and keep changes focused on the requested workflow or action.

### Code Ownership

- CODEOWNERS assigns `@3ware/repo-maintainers` by default, with explicit exceptions for paths without a designated owner.
- Keep the paths without a designated code owner in CODEOWNERS and the PR Check `path-filters` list in sync.

### Linting and Formatting

- Keep repo-specific linter configs in `.trunk/configs/`, rather than the repository root.
- For linters shared by Trunk and CodeRabbit, keep CodeRabbit’s tool disabled where Trunk owns the corresponding check.

## Project structure

- `.github/workflows/reusable-*.yaml`: reusable workflows published for callers.
Expand Down
File renamed without changes.
29 changes: 12 additions & 17 deletions .github/workflows/actions-lockfile-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Actions Lockfile Check
name: Actions Lockfile Validation

on:
pull_request:
Expand All @@ -18,24 +18,21 @@ concurrency:

jobs:
verify:
name: Verify Lockfile
name: Lockfile Check
permissions:
contents: read
runs-on: ubuntu-slim
timeout-minutes: 10
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
with:
persist-credentials: false

- name: Install GH Actions Lock Extension
run: gh extension install github/gh-actions-lock --pin "$(<.github/gh-actions-lock.version)"

- name: Verify Lockfile
run: gh actions-lock
id: verify-lockfile
uses: github/gh-actions-lock@verify/v0.5.1
with:
args: --no-interactive

update:
needs: verify
Expand All @@ -47,25 +44,23 @@ jobs:
contents: read # Required to checkout the repository
runs-on: ubuntu-latest # Uses Docker container; cannot use ubuntu-slim
timeout-minutes: 10
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
with:
persist-credentials: false

- name: Install GH Actions Lock Extension
run: gh extension install github/gh-actions-lock --pin "$(<.github/gh-actions-lock.version)"
ref: ${{ github.event.pull_request.head.sha }}

- name: Update Lockfile
run: gh actions-lock
uses: github/gh-actions-lock@verify/v0.5.1
with:
args: --no-interactive --no-onboard

# Workflow triggered by GITHUB_TOKEN require manual approval
# Use threeware-release application token for lockfile commits
# Use 3ware application token for lockfile commits
- name: Get GitHub App token
id: app-token
uses: actions/create-github-app-token@v3.3.0
uses: actions/create-github-app-token@v3.4.0
with:
client-id: ${{ secrets.THREEWARE_RELEASE_APPLICATION_ID }}
private-key: ${{ secrets.THREEWARE_RELEASE_APPLICATION_PRIVATE_KEY }}
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/actions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ version: 'v0.0.3'
workflows:
'.github/workflows/actions-lockfile-check.yaml':
- 'actions/checkout@v7.0.1'
- 'actions/create-github-app-token@v3.3.0'
- 'actions/create-github-app-token@v3.4.0'
- 'github/gh-actions-lock@verify/v0.5.1'
- 'planetscale/ghcommit-action@v0.2.22'
'.github/workflows/lint.yaml': []
'.github/workflows/pr-check.yaml':
- 'actions/checkout@v7.0.1'
- 'lekman/auto-approve-action@v1'
- 'mheap/github-action-required-labels@v5.6.0'
- 'poseidon/wait-for-status-checks@v0.7.0'
'.github/workflows/release.yaml':
- 'actions/create-github-app-token@v3.3.0'
Expand Down Expand Up @@ -52,6 +53,11 @@ dependencies:
commit: 'sha1-64ab729a6294000f5aa4a4bc0b73d1f32bc45510'
owner_id: 44036562
repo_id: 642580244
'actions/create-github-app-token@v3.4.0':
ref: 'v3.4.0'
commit: 'sha1-f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc'
owner_id: 44036562
repo_id: 642580244
'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3':
ref: 'v9.0.0'
commit: 'sha1-3a2844b7e9c422d3c10d287c895573f7108da1b3'
Expand All @@ -67,6 +73,11 @@ dependencies:
commit: 'sha1-2252a14e810aa9b85c2d560bd7070c802206ecf6'
owner_id: 4038316
repo_id: 220418983
'github/gh-actions-lock@verify/v0.5.1':
ref: 'verify/v0.5.1'
commit: 'sha1-5fa07d19c267d19e29f4341f10fdf7f516375038'
owner_id: 9919
repo_id: 1217640442
'googleapis/release-please-action@v5.0.0':
ref: 'v5.0.0'
commit: 'sha1-45996ed1f6d02564a971a2fa1b5860e934307cf7'
Expand All @@ -87,6 +98,11 @@ dependencies:
commit: 'sha1-b3018382ca039b53d238908238bd35d1fb14f8ee'
owner_id: 16359027
repo_id: 311281851
'mheap/github-action-required-labels@v5.6.0':
ref: 'v5.6.0'
commit: 'sha1-23e10fde7e062233401931a0eece796cd9bf3177'
owner_id: 59130
repo_id: 272521528
'peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1':
ref: 'v8.1.1'
commit: 'sha1-5f6978faf089d4d20b00c7766989d076bb2fc7f1'
Expand Down
48 changes: 34 additions & 14 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ jobs:

enforce-all-checks:
name: Status Checks
# Run on every event except PR title edits
# validate-pr-title will re-run checks after title corrections
# Ensures this required check runs when release-please edits the PR body
if: github.event.changes.title.from == null
permissions:
checks: read # Required to read the status of checks on the PR
runs-on: ubuntu-latest # Requires timeout longer than 15 minutes; cannot use ubuntu-slim
timeout-minutes: 30
concurrency:
group: checks-${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
# bots often trigger edited and synchronize events close together, so this
# edited events use their own group so a pending edit run cannot replace a pending
# synchronize run, which auto-approve depends on
group: checks-${{ github.workflow }}-${{ github.event.pull_request.head.ref }}-${{ github.event.action == 'edited' && 'edit' || 'push' }}
# bots often push commits and edit PRs close together, so this
# job should not be cancelled if it is already running
cancel-in-progress: false
steps:
Expand All @@ -51,11 +49,15 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
# The Checks API returns display names here, not workflow-qualified job names.
ignore_pattern: ^(Status Checks|Approve PR)$
ignore_pattern: ^(Status Checks|Approve PR|CodeRabbit)$

auto-approve-pr:
needs: enforce-all-checks
# See: https://github.com/lekman/auto-approve-action/issues/42
# Currently the action will exit with an error if it declines to approve
# Set conditions to avoid this
# auto-approve should only run on PRs created by bots and not on release-please branches
# TODO: [#14]: Remove conditions once auto-approve-action#42 is resolved
if: >-
github.event.action != 'edited'
&& contains(fromJSON('["renovate[bot]", "3ware[bot]"]'), github.event.pull_request.user.login)
Expand All @@ -70,20 +72,38 @@ jobs:
group: auto-approve-${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Check current labels
id: labels
# cspell:disable-next-line
uses: mheap/github-action-required-labels@v5.6.0
with:
persist-credentials: false
mode: exactly
# Require exactly 0 review-required labels for auto-approve to proceed
count: 0
labels: review-required
# Keep the job successful when the label is present; output.status
# still reports failure - so auto-approval is skipped
exit_type: success

- name: Auto approve
# Workaround for auto-approve-action#42: the action exits 1 when it declines to approve
if: ${{ !contains(github.event.pull_request.labels.*.name, 'review-required') }}
# cspell:disable-next-line
# The label check reports success only when review-required is absent
if: steps.labels.outputs.status == 'success'
# cspell: disable-next-line
uses: lekman/auto-approve-action@v1
with:
allowed-authors: 3ware[bot], renovate[bot]
github-token: ${{ secrets.GITHUB_TOKEN }}
max-files-changed: "10"
# The action approves when ANY changed file matches (auto-approve-action#45), so this
# is not a gate on its own. CODEOWNERS is the control: the bot cannot satisfy code owner
# review, so only files without an owner can be approved. Keep in sync with CODEOWNERS.
path-filters: >-
.github/gh-actions-lock.version,
.github/workflows/actions-lockfile-check.yaml,
.github/workflows/lint.yaml,
.github/workflows/release.yaml,
.github/workflows/scheduled.yaml,
.github/workflows/trunk-upgrade.yaml,
.trunk/trunk.yaml
merge-method: squash
path-filters: .github/gh-actions-lock.version,.github/workflows/**,.trunk/trunk.yaml
required-labels: auto-merge
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
permissions: {}

concurrency:
group: release-please
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Scheduled
on:
schedule:
- cron: 0 0 1 * *
workflow_dispatch: {}

# Disable permissions for all available scopes
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.repository }}
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/trunk-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ on:
schedule:
# On the first day of every month @ 8am
- cron: 0 8 1 * *
workflow_dispatch: {}

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
Expand Down
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"artipacked",
"chazypro",
"chdir",
"coderabbit",
"color",
"commitlint",
"commitlintrc",
Expand Down