Skip to content

Commit 2f4b5a1

Browse files
committed
added github actions for security, metric and super-linter
added github actions for gosec (security), metric embedded for github and super-linter
1 parent 2e6326e commit 2f4b5a1

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

.github/workflows/gosec.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# GoSec Security Checker
2+
# This workflow runs gosec to check Go code for security issues
3+
name: GoSec Security Checker
4+
5+
on:
6+
push:
7+
paths:
8+
- '**.go'
9+
pull_request:
10+
paths:
11+
- '**.go'
12+
13+
jobs:
14+
gosec:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.22'
23+
- name: Install gosec
24+
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
25+
- name: Run gosec
26+
run: ~/go/bin/gosec ./...

.github/workflows/metrics.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# GitHub Metrics
2+
# This workflow generates a metrics SVG and commits it to the repository
3+
name: Metrics Embed
4+
5+
on:
6+
schedule: [{cron: "0 0 * * 0"}] # every week
7+
workflow_dispatch:
8+
9+
jobs:
10+
github-metrics:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Metrics embed
14+
uses: lowlighter/metrics@latest
15+
with:
16+
filename: metrics.svg
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
base: "header, activity, community, repositories, metadata"
19+
plugin_languages: yes
20+
plugin_traffic: yes
21+
- name: Commit metrics
22+
run: |
23+
git config --global user.name 'github-actions[bot]'
24+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
25+
git add metrics.svg
26+
git commit -m "chore: update metrics [skip ci]" || echo "No changes to commit"
27+
git push

.github/workflows/super-linter.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Super-Linter
2+
# This workflow runs GitHub's Super-Linter on push and pull requests
3+
name: Super-Linter
4+
5+
on: # yamllint disable-line rule:truthy
6+
push: null
7+
pull_request: null
8+
9+
permissions: {}
10+
11+
jobs:
12+
build:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
contents: read
18+
packages: read
19+
# To report GitHub Actions status checks
20+
statuses: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
# super-linter needs the full git history to get the
27+
# list of files that changed across commits
28+
fetch-depth: 0
29+
30+
- name: Super-linter
31+
uses: super-linter/super-linter@v8.0.0 # x-release-please-version
32+
env:
33+
# To report GitHub Actions status checks
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)