-
Notifications
You must be signed in to change notification settings - Fork 10
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
Filipe Forattini
committed
May 11, 2022
1 parent
43f42e7
commit ccada2c
Showing
2 changed files
with
205 additions
and
0 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,89 @@ | ||
name: self-pull-request | ||
on: [ pull_request ] | ||
|
||
|
||
jobs: | ||
|
||
Base-Analysis: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
# pre-job | ||
- name: Setup | Cloning repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
#job | ||
- name: Run GitLeaks | ||
uses: docker://opendevsecops/gitleaks | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: --repo=https://github.com/${{github.repository}} | ||
|
||
- name: 'Dependency Review' | ||
uses: actions/dependency-review-action@v1 | ||
|
||
Language-Analysis: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
language: | ||
- javascript | ||
|
||
steps: | ||
# pre-job | ||
- name: Setup | Cloning repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
#job | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: ${{ matrix.language }}-${{ env.GITHUB_SHA }} | ||
|
||
- name: Upload sarif file | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
category: ${{ matrix.language }}-${{ env.GITHUB_SHA }} | ||
|
||
Ossar-Analysis: | ||
runs-on: windows-latest | ||
|
||
permissions: | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run OSSAR | ||
uses: github/ossar-action@v1 | ||
id: ossar | ||
|
||
- name: Upload OSSAR results | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: ${{ steps.ossar.outputs.sarifFile }} |
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,116 @@ | ||
name: self-push | ||
on: [ push ] | ||
|
||
|
||
jobs: | ||
|
||
|
||
Base-Analysis: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
# pre-job | ||
- name: Setup | Cloning repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
#job | ||
- name: Run GitLeaks | ||
uses: docker://opendevsecops/gitleaks | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: --repo=https://github.com/${{github.repository}} | ||
|
||
|
||
Language-Analysis: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
language: | ||
- javascript | ||
|
||
steps: | ||
# pre-job | ||
- name: Setup | Cloning repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
#job | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: ${{ matrix.language }}-${{ env.GITHUB_SHA }} | ||
|
||
- name: Upload sarif file | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
category: ${{ matrix.language }}-${{ env.GITHUB_SHA }} | ||
|
||
Ossar-Analysis: | ||
runs-on: windows-latest | ||
|
||
permissions: | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run OSSAR | ||
uses: github/ossar-action@v1 | ||
id: ossar | ||
|
||
- name: Upload OSSAR results | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: ${{ steps.ossar.outputs.sarifFile }} | ||
|
||
|
||
Release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- Base-Analysis | ||
- Language-Analysis | ||
- Ossar-Analysis | ||
|
||
steps: | ||
- name: Cloning repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Semantic Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npm i -g -D \ | ||
semantic-release \ | ||
@semantic-release/git \ | ||
@semantic-release/github \ | ||
@semantic-release/changelog \ | ||
@semantic-release/commit-analyzer \ | ||
@semantic-release/release-notes-generator | ||
semantic-release |