Skip to content
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

test: resuable actions #1973

Closed
wants to merge 3 commits into from
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
10 changes: 10 additions & 0 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: gitleaks-scan
on:
workflow_dispatch:
push:
jobs:
gitleaks-scan:
uses: button-inc/button-shared-gh-actions/.github/workflows/scan-code-gitleaks.yml@develop
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
gitleaks-license: ${{ secrets.GITLEAKS_LICENSE}}
9 changes: 9 additions & 0 deletions .github/workflows/owasp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: zap-scan
on:
workflow_dispatch:
# push:
jobs:
zap-scan:
uses: button-inc/button-shared-gh-actions/.github/workflows/scan-code-owasp-zap.yml@develop
with:
target-url: 'http://localhost:3000/applicantportal'
10 changes: 10 additions & 0 deletions .github/workflows/sonarcloud.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: sonarcloud-scan
on:
workflow_dispatch:
# push:
jobs:
sonarcloud-scan:
uses: button-inc/button-shared-gh-actions/.github/workflows/scan-code-sonarcloud.yml@develop
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN}}
34 changes: 9 additions & 25 deletions .github/workflows/test-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: fs
format: sarif
output: trivy-results.sarif
exit-code: '0'
ignore-unfixed: false
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
- name: trivy scan
uses: ./.github/workflows/trivy.yaml

codeql-scan:
name: codeql-scan
Expand Down Expand Up @@ -89,12 +76,12 @@ jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: ./.bin/install-gitleaks-linux-x64.sh
- run: ./gitleaks detect --exit-code 0 --report-format sarif --report-path "gitleaks.sarif"
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'gitleaks.sarif'
uses: ./.github/workflows/gitleaks.yaml
# - run: ./.bin/install-gitleaks-linux-x64.sh
# - run: ./gitleaks detect --exit-code 0 --report-format sarif --report-path "gitleaks.sarif"
# - uses: github/codeql-action/upload-sarif@v2
# with:
# sarif_file: 'gitleaks.sarif'

jest:
needs: [install-test-env]
Expand All @@ -111,10 +98,7 @@ jobs:
working-directory: ./app
run: yarn test --coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
uses: ./.github/workflows/sonarcloud.yaml

eslint:
needs: [install-test-env]
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: trivy-scan
on:
workflow_dispatch:
# push:
jobs:
trivy-scan:
uses: button-inc/button-shared-gh-actions/.github/workflows/scan-code-trivy.yml@develop