From f0279e2de1a35d210a6f0cc48199edf2e523faf6 Mon Sep 17 00:00:00 2001 From: RyosukeDTomita Date: Mon, 17 Jun 2024 10:21:52 +0900 Subject: [PATCH] use githu-comment chore: Update GitHub Actions workflow for installing dependencies and running tests fix path fix path2 --- .github/workflows/react-jest.yaml | 15 +++++++++++++-- .github/workflows/react-semgrep.yaml | 7 +++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/react-jest.yaml b/.github/workflows/react-jest.yaml index 7ee2bf5..275e6cb 100644 --- a/.github/workflows/react-jest.yaml +++ b/.github/workflows/react-jest.yaml @@ -8,6 +8,10 @@ defaults: jobs: frontend-jest: # job id(Typed by user) runs-on: ubuntu-latest + defaults: + # デフォルトのワーキングディレクトリのため設定不要だが,明示的に指定。 + run: + working-directory: /home/runner/work/devsecops-demo-aws-ecs/devsecops-demo-aws-ecs steps: # Checkout repository to runner @@ -18,8 +22,15 @@ jobs: with: node-version: '20' + - 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: Install Dependencies - run: cd /home/runner/work/devsecops-demo-aws-ecs/devsecops-demo-aws-ecs && npm install + run: github-comment exec --token ${{ secrets.TOKEN }} -- npm install - name: Run npm test - run: cd /home/runner/work/devsecops-demo-aws-ecs/devsecops-demo-aws-ecs && npm test -- --watchAll=false + run: github-comment exec --token ${{ secrets.TOKEN }} -- npm test -- --watchAll=false diff --git a/.github/workflows/react-semgrep.yaml b/.github/workflows/react-semgrep.yaml index b7f208b..7214c6c 100644 --- a/.github/workflows/react-semgrep.yaml +++ b/.github/workflows/react-semgrep.yaml @@ -17,10 +17,13 @@ jobs: 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: full scan run: | - semgrep \ + github-comment exec --token ${{ secrets.TOKEN }} -- semgrep \ --sarif --output report.sarif \ --metrics=off \ --config="p/default"