Skip to content

change condition

change condition #50

Workflow file for this run

name: Gosec
on:
# schedule:
# # This is meant to run every day at 9am
# - cron: '1-5'
push:
jobs:
gosec:
runs-on: ubuntu-latest
continue-on-error: true
env:
GO111MODULE: on
outputs:
gosec-output: ${{ steps.gosec-run.outputs.gosec-output }}
steps:
- name: Checkout Source
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: Run Gosec
id: gosec-run
uses: securego/gosec@master
with:
args: '-exclude=G104,G115,G304,G406,G507 ./...'
- name: Capture Gosec Output
if: failure()
continue-on-error: true
run: echo "gosec-output=error" >> $GITHUB_OUTPUT
notify-slack:
name: Notify Slack
needs:
- gosec
if: always() && needs.gosec.outputs.gosec-output == 'error'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Notify Slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.GOSEC_SLACK_WEBHOOK }}
with:
payload: |
{
"commit-url": "${{ github.event.head_commit.url }}",
"branch": "${{ github.ref }}",
"repository": "${{ github.repository }}"
}