👷 [skip ci] gosec code scanner
This commit is contained in:
parent
20ea31140b
commit
3f76e700d2
16
.github/workflows/dashboard.yml
vendored
16
.github/workflows/dashboard.yml
vendored
@ -11,6 +11,7 @@ on:
|
|||||||
- "*.md"
|
- "*.md"
|
||||||
- ".*"
|
- ".*"
|
||||||
- ".github/workflows/agent.yml"
|
- ".github/workflows/agent.yml"
|
||||||
|
- ".github/workflows/gosec.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@ -31,18 +32,13 @@ jobs:
|
|||||||
registry: registry.cn-shanghai.aliyuncs.com
|
registry: registry.cn-shanghai.aliyuncs.com
|
||||||
username: ${{ secrets.ALI_USER }}
|
username: ${{ secrets.ALI_USER }}
|
||||||
password: ${{ secrets.ALI_PAT }}
|
password: ${{ secrets.ALI_PAT }}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Code Test
|
|
||||||
run: |
|
|
||||||
go env
|
|
||||||
go test -v ./...
|
|
||||||
|
|
||||||
- name: Set up image name
|
- name: Set up image name
|
||||||
run: |
|
run: |
|
||||||
GHRC_IMAGE_NAME=$(echo "ghcr.io/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
|
GHRC_IMAGE_NAME=$(echo "ghcr.io/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
|
||||||
@ -53,7 +49,7 @@ jobs:
|
|||||||
echo "::set-output name=GHRC_IMAGE_NAME::$GHRC_IMAGE_NAME"
|
echo "::set-output name=GHRC_IMAGE_NAME::$GHRC_IMAGE_NAME"
|
||||||
echo "::set-output name=ALI_IMAGE_NAME::$ALI_IMAGE_NAME"
|
echo "::set-output name=ALI_IMAGE_NAME::$ALI_IMAGE_NAME"
|
||||||
id: image-name
|
id: image-name
|
||||||
|
|
||||||
- name: Build dasbboard image And Push
|
- name: Build dasbboard image And Push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
@ -64,7 +60,7 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}
|
${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}
|
||||||
${{ steps.image-name.outputs.ALI_IMAGE_NAME }}
|
${{ steps.image-name.outputs.ALI_IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Purge jsdelivr cache
|
- name: Purge jsdelivr cache
|
||||||
run: |
|
run: |
|
||||||
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/install.sh
|
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/install.sh
|
||||||
|
22
.github/workflows/test.yml
vendored
Normal file
22
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Run Test
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GO111MODULE: on
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Unit test
|
||||||
|
run: |
|
||||||
|
go test -v ./...
|
||||||
|
- name: Run Gosec Security Scanner
|
||||||
|
uses: securego/gosec@master
|
||||||
|
with:
|
||||||
|
args: ./...
|
Loading…
x
Reference in New Issue
Block a user