Skip to content

Minor refactor in scanners #62

Minor refactor in scanners

Minor refactor in scanners #62

Workflow file for this run

name: Test and Update Coverage
on:
pull_request:
branches:
- main
jobs:
test_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
ref: ${{ github.head_ref }}
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Install dependencies
run: sudo apt update && sudo apt install -y make libpcap-dev
- name: Run Test
run: |
make test
make coverage
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage/coverage.out
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: README.md
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit --amend --no-edit
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}
force: true