Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.
Closed
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
47 changes: 47 additions & 0 deletions .github/workflows/lint__csharp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: lint__csharp

# MANAGED BY shunsock/github_central — このファイルは gh-infra で配信される。
# 変更は github_central 側の workflows/ で行うこと。直接編集しても同期で上書きされうる。
#
# リポジトリ内の C# ソース (.cs) を CSharpier でフォーマット検査する。
# .cs を持たないリポジトリでは検出ステップで止まり no-op で成功するため、
# 全リポジトリへ安全に配信できる。

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
csharpier:
name: csharpier
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Detect C# sources
id: detect
run: |
if find . -name '*.cs' -not -path './.git/*' | grep -q .; then
echo "found=true" >> "$GITHUB_OUTPUT"
fi

# CSharpier は dotnet tool として version を固定し再現性を担保する
# (.NET SDK は runner に同梱)。
- name: Install CSharpier
if: steps.detect.outputs.found == 'true'
run: dotnet tool install --global csharpier --version 1.3.0

- name: Check formatting (csharpier)
if: steps.detect.outputs.found == 'true'
run: csharpier check .
86 changes: 86 additions & 0 deletions .github/workflows/lint__github_actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: lint__github_actions

# MANAGED BY shunsock/github_central — このファイルは gh-infra で配信される。
# 変更は github_central 側の workflows/ で行うこと。直接編集しても同期で上書きされうる。
#
# .github/workflows 配下の GitHub Actions workflow を静的解析する。
# actionlint: 構文・式・埋め込み shell script の検証
# ghalint: workflow のセキュリティポリシー (permission 明示・SHA pin など) の強制
# zizmor: supply-chain 観点のセキュリティ監査
# 3 ツールは互いに独立した観点を持つため job を分離し、片方が落ちても他方を実行する。

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
actionlint:
name: actionlint
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

# actionlint は runner 同梱の shellcheck を呼び出し run ブロックの shell も検証する。
# go install で version を固定し再現性を担保する (runner に Go は同梱)。
- name: Install actionlint
run: |
go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
echo "$(go env GOPATH)/bin" >> "${GITHUB_PATH}"

- name: Run actionlint
run: actionlint

ghalint:
name: ghalint
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Install ghalint
run: |
go install github.com/suzuki-shunsuke/ghalint/cmd/ghalint@v1.5.6
echo "$(go env GOPATH)/bin" >> "${GITHUB_PATH}"

- name: Run ghalint
run: ghalint run

zizmor:
name: zizmor
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

# zizmor 本体の version を固定し再現性を担保する。
# private リポジトリ (GitHub Advanced Security 未契約) にも配信するため SARIF upload は
# 使わない。advanced-security: false で annotation に fallback し (security-events 権限も
# 不要)、online-audits: false で外部 API へ問い合わせず決定的に監査する。
- name: Run zizmor
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
with:
version: v1.25.2
advanced-security: false
annotations: true
online-audits: false
50 changes: 50 additions & 0 deletions .github/workflows/lint__shell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: lint__shell

# MANAGED BY shunsock/github_central — このファイルは gh-infra で配信される。
# 変更は github_central 側の workflows/ で行うこと。直接編集しても同期で上書きされうる。
#
# リポジトリ内の shell script に対して format (shfmt) と lint (shellcheck) を実行する。
# shfmt -f が shebang と拡張子から script を検出するため、shell script を持たない
# リポジトリでは何も実行せず成功する (xargs -r)。全リポジトリへ安全に配信できる。

on:
push:
branches: [main]
pull_request:
branches: [main]

# 既定では何も書き込ませない (最小権限)。checkout に必要な read のみ付与する。
permissions:
contents: read

jobs:
shell_lint:
name: shfmt & shellcheck
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# lint 専用 job では認証情報を残す必要がない (最小権限)。
persist-credentials: false

# shellcheck は runner に同梱されているが shfmt は無いため go install で導入する。
# version を固定して再現性を担保する。
- name: Install shfmt
run: |
go install mvdan.cc/sh/v3/cmd/shfmt@v3.10.0
echo "$(go env GOPATH)/bin" >> "${GITHUB_PATH}"

# shfmt -f が shebang と拡張子から shell script を検出する。
# これを唯一の検出源とし、整形差分があれば失敗する。
- name: Check formatting (shfmt)
run: shfmt -f . | xargs -r -d '\n' shfmt -d

# --external-sources で source 先 (bin/library/*.sh) を追跡し、
# 呼び出し元込みの文脈で lint する。format が落ちても lint は実行する。
- name: Lint (shellcheck)
if: ${{ !cancelled() }}
run: shfmt -f . | xargs -r -d '\n' shellcheck --external-sources
Loading