-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5987d20
commit 64fcaae
Showing
7 changed files
with
158 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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,20 @@ | ||
name: actions-lint | ||
on: | ||
pull_request: | ||
# paths: | ||
# - .github/workflows/*.yaml | ||
jobs: | ||
run-ghalint: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: read | ||
steps: | ||
- name: clone application source code | ||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | ||
- name: install package using aqua | ||
uses: aquaproj/aqua-installer@6ce1f8848ec8e61f14d57bd5d7597057a6dd187c # v3.0.1 | ||
with: | ||
aqua_version: v2.29.0 | ||
- name: run ghalint | ||
run: github-comment exec --token ${{ secrets.token }} -- ghalint run |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,48 @@ | ||
# ghalint | ||
|
||
## ghalintとは | ||
|
||
> [ghalintが検知してPolicy](https://github.com/suzuki-shunsuke/ghalint?tab=readme-ov-file#policies) | ||
> [permissionsの一覧が載っているページ](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions) | ||
--- | ||
|
||
## install | ||
|
||
```shell | ||
aqua g -i suzuki-shunsuke/[email protected] | ||
``` | ||
|
||
--- | ||
|
||
## How to Use | ||
|
||
```shell | ||
ghalint run | ||
``` | ||
|
||
--- | ||
|
||
## 修正log | ||
|
||
### All jobs should have the field permissions | ||
|
||
- [内容](https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/001.md): すべてのjobにpermissionをつけないといけない。 | ||
|
||
```yaml | ||
jobs: | ||
|
||
trivy-scan: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
security-events: write | ||
``` | ||
> [!NOTE] | ||
> [codeql-action](https://github.com/github/codeql-action/issues/464)には`security-events: write`が必要 | ||
|
||
### the step violates policies | ||
|
||
- [内容](https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/008.md): フルコミットハッシュにすれば解決。 | ||
|
||
### the job violates policies |
This file contains 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,44 @@ | ||
# pinact | ||
|
||
## pinactとは | ||
|
||
- GitHub Actionsのactionのバージョンが実行タイミングによって内容が変わると突然CIが壊れたり,悪意のあるコードが実行される可能性がある --> フルコミットハッシュを用いてバージョンを固定すべきである。 | ||
- pinactを使うとフルコミットハッシュに変換し,コメントでバージョンを記載してくれる。 | ||
|
||
## install | ||
|
||
- [GitHub](https://github.com/suzuki-shunsuke/pinact#install)をみてinstallする。 | ||
|
||
```shell | ||
aqua g -i suzuki-shunsuke/pinact | ||
``` | ||
|
||
## HOW TO USE | ||
|
||
```shell | ||
pinact run | ||
``` | ||
|
||
- actions/ツール名@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 のような表記に変換してくれる。 | ||
|
||
```yaml | ||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | ||
``` | ||
--- | ||
## Error log | ||
### 401 Bad credentials | ||
```shell | ||
pinact run | ||
WARN[0000] get a reference error="GET https://api.github.com/repos/aquasecurity/trivy-action/commits/v0.21.0: 401 Bad credentials []" pinact_version=0.2.0 program=pinact workflow_file=.github/workflows/react-dependency-check.yaml | ||
``` | ||
[公式のREADME](https://github.com/suzuki-shunsuke/pinact#github-access-token)を見ると, | ||
> pinact calls GitHub REST API to get commit hashes and tags. You can pass GitHub Access token via environment variable GITHUB_TOKEN. If no GitHub Access token is passed, pinact calls GitHub REST API without access token. | ||
のような記載があり,GITHUB_TOKENをexportしているとそれを使ってpinactを起動しようとするらしい。 | ||
そのため,GITHUB_TOKENをunexportしたら解決。 |
This file was deleted.
Oops, something went wrong.