-
Notifications
You must be signed in to change notification settings - Fork 0
feat: GitHub Actions で静的チェックを実行する #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fd27a91
feat: GitHub Actions で静的チェックを実行する
kenshin-morioka 158c6d2
fix: fast-xml-parser@4.5.7 を検証の上 trust policy から除外
kenshin-morioka 4a96567
fix: CI の InfraMap 導入を go install に変更
kenshin-morioka de58b9a
fix: checkov を確実に実行し、プレースホルダの警告は理由付きでスキップ
kenshin-morioka 0432ca9
fix: checkout で GITHUB_TOKEN を保持しない (persist-credentials: false)
kenshin-morioka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # push / PR のたびに IaC の静的チェックと構成図生成を検証するワークフロー。 | ||
| # | ||
| # 安全対策: | ||
| # - AWS credentials は一切使わない (GitHub Secrets にも設定しない) | ||
| # - 実行するのは validate / lint / 図生成のみで、AWS へは接続しない | ||
| name: validate | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
|
|
||
| # リポジトリの読み取りだけできれば十分 | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # mise.toml に固定したツール (terraform / tflint / checkov / cfn-lint / cfn-dia) を導入 | ||
| - uses: jdx/mise-action@v2 | ||
|
|
||
| # SAM CLI (mise 管理外なので公式 action で導入) | ||
| - uses: aws-actions/setup-sam@v2 | ||
| with: | ||
| use-installer: true | ||
|
|
||
| # 構成図生成用: Graphviz は apt、InfraMap は Homebrew (ランナーに標準搭載) で導入 | ||
| - name: Install diagram tools | ||
| run: | | ||
| sudo apt-get update -qq && sudo apt-get install -y -qq graphviz | ||
| brew install inframap | ||
|
|
||
| # ローカルの学習サイクルと同じ一括チェックを実行する | ||
| - name: Run make check | ||
| run: make check | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| # プロジェクトで使うツールとバージョンの固定 (mise install で一括導入)。 | ||
| # CI (GitHub Actions) でも同じ定義を使うため、"latest" ではなく明示的に固定する | ||
| [tools] | ||
| "pipx:checkov" = "latest" | ||
| terraform = "latest" | ||
| tflint = "latest" | ||
| "pipx:cfn-lint" = "latest" | ||
| "npm:@mhlabs/cfn-diagram" = "latest" | ||
| terraform = "1.15.8" | ||
| tflint = "0.64.0" | ||
| "pipx:checkov" = "3.3.9" | ||
| "pipx:cfn-lint" = "1.54.0" | ||
| # fast-xml-parser@4.5.7 は provenance 無しのため mise の trust policy に検出されるが、 | ||
| # npm tarball と GitHub の v4.5.7 タグのソース一致・公開者が 4.x 系従来のメンテナ本人 | ||
| # であることを確認済み (5.x のみ trusted publishing を使う運用のため)。この 1 バージョン | ||
| # だけを検証済みとして除外する | ||
| "npm:@mhlabs/cfn-diagram" = { version = "1.1.40", trust_policy_excludes = ["fast-xml-parser@4.5.7"] } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.