Skip to content

Commit

Permalink
Merge pull request #33 from RyosukeDTomita/feature/path-filter
Browse files Browse the repository at this point in the history
Feature/path filter
  • Loading branch information
RyosukeDTomita authored Jun 17, 2024
2 parents 77b1e63 + 7b32660 commit 2dacfbc
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/react-dependency-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: trivy dependency check for package.json
# https://github.com/aquasecurity/trivy-action#usage
on:
push:
paths:
- "src/**.tsx"
- "src/**.ts"
- "public/**.html"
schedule:
# 日曜日の午前0時に実行
- cron: '0 0 * * 0'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/react-jest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: run-jest
on: [push]
on:
push:
paths:
- "src/**.tsx"
- "src/**.ts"
- "public/**.html"

defaults:
run:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/react-semgrep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Semgrep Full Scan
#リポジトリの設定から --> Code and automation --> Actions --> GeneralのWorkflow permissionsをRead and write permissionsに[参考画像](../../doc/fig/semgrep_upgrade_grant.png)
on:
push:
paths:
- "src/**.tsx"
- "src/**.ts"
- "public/**.html"
schedule:
# 日曜日の午前0時に実行
- cron: '0 0 * * 0'
Expand Down
22 changes: 19 additions & 3 deletions doc/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ actions/setup-python@コミットハッシュ

## GitHub ActionsでSecretを扱う

> [公式ドキュメント](https://docs.github.com/ja/actions/security-guides/using-secrets-in-github-actions)
> GUIの場合は[公式ドキュメント](https://docs.github.com/ja/actions/security-guides/using-secrets-in-github-actions)参照。
### 2種類のシークレット

Expand All @@ -41,8 +41,8 @@ actions/setup-python@コミットハッシュ

### 使用方法(CLI)

> [GitHub CLIでリポジトリへsecretを設定](https://zenn.dev/hankei6km/articles/set-secret-to-repo-with-githubcli)
> [GitHub Actionsで機密情報を扱う方法](https://qiita.com/ak2ie/items/4fbcdf74e7760c49c1af)
> [GitHub CLIでリポジトリへsecretを設定する方法](https://zenn.dev/hankei6km/articles/set-secret-to-repo-with-githubcli)
> [GitHub ActionsでEnvironment Secretを扱うサンプル](https://qiita.com/ak2ie/items/4fbcdf74e7760c49c1af)
- 個人的には.envから一括投入するのが使いやすそう。今回の例では--envを指定しているが指定しないとRepository Secretになる。

Expand All @@ -68,6 +68,22 @@ jobs:
---
## path filterを使って特定のファイル変更時のみCIを走らせる
- デフォルト設定だと,どのファイルが修正されてもCIが走ってしまうので必要なファイルが更新された時だけCIが起動できるようにする。
```shell
name: run-jest
on:
push:
paths:
- "src/**.tsx"
- "src/**.ts"
- "public/**.html"
```
---
## CodeQLを使ってファイルを出力
### Advanced Security must be enabled for this repository to use code scanning 403: GitHub Advanced Security is not enabled
Expand Down
2 changes: 2 additions & 0 deletions doc/tools_doc/github-comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ GitHub Actionsを使いたい場合には後述の手順を参照。

## 使い方

> [公式ドキュメント](https://suzuki-shunsuke.github.io/github-comment/getting-started)
### 共通してやること

- github-comment.yaml(template)を用意する。
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import { render, screen } from "@testing-library/react";
import App from "../App";

// 画面にLearn Reactの文字が出るかテスト
test("renders learn react link", () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
Expand Down

0 comments on commit 2dacfbc

Please sign in to comment.