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
27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Check

on:
pull_request:
branches: [main, 'tree/**']
merge_group:

permissions:
contents: read

concurrency:
group: pr-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
name: test
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@main
with:
persist-credentials: false

- uses: ./actions/mise-check
with:
task: check:pr
2 changes: 1 addition & 1 deletion .github/workflows/self-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: self-check

on:
push:
pull_request:
branches: [main, 'tree/**']

permissions:
contents: read
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# ci

`mouriya-devops` 与 `mouriya-s-lab` 仓库共用的 GitHub Actions 可复用 workflow。设计见私有仓库 [mouriya-devops/design](https://github.com/mouriya-devops/design)。

## 检查

- PR 与 `merge_group`:`.github/workflows/pr.yml` 产出唯一顶层 CheckRun `test`,执行 `mise run check:pr`。
- `main` 与 `tree/**` 的 push:`self-check.yml` 执行 `mise run check`。
9 changes: 7 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
[tools]
"aqua:rhysd/actionlint" = "latest"
shellcheck = "latest"
bun = "latest"

[tasks."check:pr"]
description = "Lint every workflow in .github/workflows with actionlint and shellcheck, then run the offline workflow policy self-test"
run = "actionlint && bun test selftest"

[tasks.check]
description = "Lint every workflow in .github/workflows"
run = "actionlint"
description = "Run every check: actionlint and shellcheck on .github/workflows, then the workflow policy self-test"
depends = ["check:pr"]

[tasks."selftest:task"]
description = "Self-test fixture for actions/mise-check and the check.yml task input: report CI and leave a marker"
Expand Down
Loading