ci: Additional githubaction configuration (#3034)
- Pin action versions - Dependabot to notify about action updates - Update codeowners
This commit is contained in:
1 parent
713c121143
commit
236d7ca872
16 files changed
+100
-99
No files matched your search
@@ -9,10 +9,10 @@ on:
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.RUNNER) }}
|
||||
if: ${{ github.actor != 'dependabot[bot]' || github.actor != 'hc-github-team-secure-boundary' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Determine Go version
|
||||
id: get-go-version
|
||||
@@ -20,20 +20,20 @@ jobs:
|
||||
# version, because "goenv" can react to it automatically.
|
||||
run: |
|
||||
echo "Building with Go $(cat .go-version)"
|
||||
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
|
||||
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
with:
|
||||
go-version: "${{ steps.get-go-version.outputs.go-version }}"
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@98f2ad02fd48d057ee3b4d4f66525b231c3e52b6 # v3.1.2
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
- name: Clone Security Scanner repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
with:
|
||||
repository: hashicorp/security-scanner
|
||||
token: ${{ secrets.HASHIBOT_PRODSEC_GITHUB_TOKEN }}
|
||||
@@ -45,26 +45,26 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
mkdir $HOME/.bin
|
||||
cd $GITHUB_WORKSPACE/security-scanner/pkg/sdk/examples/scan-plugin-semgrep
|
||||
mkdir "$HOME/.bin"
|
||||
cd "$GITHUB_WORKSPACE/security-scanner/pkg/sdk/examples/scan-plugin-semgrep"
|
||||
go build -o scan-plugin-semgrep .
|
||||
mv scan-plugin-semgrep $HOME/.bin
|
||||
|
||||
cd $GITHUB_WORKSPACE/security-scanner/pkg/sdk/examples/scan-plugin-codeql
|
||||
mv scan-plugin-semgrep "$HOME/.bin"
|
||||
|
||||
cd "$GITHUB_WORKSPACE/security-scanner/pkg/sdk/examples/scan-plugin-codeql"
|
||||
go build -o scan-plugin-codeql .
|
||||
mv scan-plugin-codeql $HOME/.bin
|
||||
|
||||
mv scan-plugin-codeql "$HOME/.bin"
|
||||
|
||||
# Semgrep
|
||||
python3 -m pip install semgrep
|
||||
|
||||
|
||||
# CodeQL
|
||||
LATEST=$(gh release list --repo https://github.com/github/codeql-action | cut -f 3 | sort --version-sort | tail -n1)
|
||||
gh release download --repo https://github.com/github/codeql-action --pattern codeql-bundle-linux64.tar.gz "$LATEST"
|
||||
tar xf codeql-bundle-linux64.tar.gz -C $HOME/.bin
|
||||
|
||||
tar xf codeql-bundle-linux64.tar.gz -C "$HOME/.bin"
|
||||
|
||||
# Add to PATH
|
||||
echo "$HOME/.bin" >> $GITHUB_PATH
|
||||
echo "$HOME/.bin/codeql" >> $GITHUB_PATH
|
||||
echo "$HOME/.bin" >> "$GITHUB_PATH"
|
||||
echo "$HOME/.bin/codeql" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Scan
|
||||
id: scan
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
repository: "$PWD"
|
||||
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
uses: github/codeql-action/upload-sarif@e00cd12e3ee0ce24d476645336a315351be51d88 # TSCCR: actions in subdirectories not yet supported: upload-sarif
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
Reference in new issue
Block a user