Skip to content

Commit 24acf6a

Browse files
author
Jaco Labuschagne
committed
Add disabled linting and security workflows
- Introduced new workflows for Go linting and security scanning, both marked as disabled until further notice. - Updated existing workflows to allow manual execution with a reason input. - Removed linting steps from the test workflow and updated the test script to reflect the disabled linting functionality.
1 parent e524556 commit 24acf6a

6 files changed

Lines changed: 236 additions & 29 deletions

File tree

.github/workflows/lint.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Go Lint (DISABLED)
2+
3+
# This workflow is currently disabled until further notice
4+
5+
on:
6+
# Disable triggers by commenting them out
7+
# push:
8+
# branches: [ master ]
9+
# pull_request:
10+
# branches: [ master ]
11+
12+
# Only run manually
13+
workflow_dispatch:
14+
inputs:
15+
reason:
16+
description: 'Reason for manual run'
17+
required: true
18+
default: 'Testing disabled linting workflow'
19+
20+
jobs:
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Set up Go
26+
uses: actions/setup-go@v4
27+
with:
28+
go-version: 1.24.x
29+
30+
- name: Check out code
31+
uses: actions/checkout@v4
32+
33+
- name: Install golangci-lint
34+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.0
35+
36+
- name: Create golangci-lint config
37+
run: |
38+
cat > .golangci.yml << EOL
39+
run:
40+
timeout: 5m
41+
tests: true
42+
skip-dirs:
43+
- internal/parser/gen
44+
45+
linters:
46+
disable-all: true
47+
enable:
48+
- errcheck
49+
- gosimple
50+
- govet
51+
- ineffassign
52+
- staticcheck
53+
- unused
54+
EOL
55+
56+
- name: Run golangci-lint
57+
run: $(go env GOPATH)/bin/golangci-lint run -v
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Go Lint (DISABLED)
2+
3+
# This workflow is currently disabled until further notice
4+
5+
on:
6+
# Disable triggers by commenting them out
7+
# push:
8+
# branches: [ master ]
9+
# pull_request:
10+
# branches: [ master ]
11+
12+
# Only run manually
13+
workflow_dispatch:
14+
inputs:
15+
reason:
16+
description: 'Reason for manual run'
17+
required: true
18+
default: 'Testing disabled linting workflow'
19+
20+
jobs:
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Set up Go
26+
uses: actions/setup-go@v4
27+
with:
28+
go-version: 1.24.x
29+
30+
- name: Check out code
31+
uses: actions/checkout@v4
32+
33+
- name: Install golangci-lint
34+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.0
35+
36+
- name: Create golangci-lint config
37+
run: |
38+
cat > .golangci.yml << EOL
39+
run:
40+
timeout: 5m
41+
tests: true
42+
skip-dirs:
43+
- internal/parser/gen
44+
45+
linters:
46+
disable-all: true
47+
enable:
48+
- errcheck
49+
- gosimple
50+
- govet
51+
- ineffassign
52+
- staticcheck
53+
- unused
54+
EOL
55+
56+
- name: Run golangci-lint
57+
run: $(go env GOPATH)/bin/golangci-lint run -v

.github/workflows/security.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
name: Security Scanning
1+
name: Security Scanning (DISABLED)
2+
3+
# This workflow is currently disabled until further notice
24

35
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
8-
schedule:
9-
- cron: '0 0 * * 0' # Run once a week on Sunday at midnight
6+
# Disable triggers by commenting them out
7+
# push:
8+
# branches: [ master ]
9+
# pull_request:
10+
# branches: [ master ]
11+
# schedule:
12+
# - cron: '0 0 * * 0' # Run once a week on Sunday at midnight
13+
14+
# Only run manually
15+
workflow_dispatch:
16+
inputs:
17+
reason:
18+
description: 'Reason for manual run'
19+
required: true
20+
default: 'Testing disabled security workflow'
1021

1122
jobs:
1223
gosec:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Security Scanning (DISABLED)
2+
3+
# This workflow is currently disabled until further notice
4+
5+
on:
6+
# Disable triggers by commenting them out
7+
# push:
8+
# branches: [ master ]
9+
# pull_request:
10+
# branches: [ master ]
11+
# schedule:
12+
# - cron: '0 0 * * 0' # Run once a week on Sunday at midnight
13+
14+
# Only run manually
15+
workflow_dispatch:
16+
inputs:
17+
reason:
18+
description: 'Reason for manual run'
19+
required: true
20+
default: 'Testing disabled security workflow'
21+
22+
jobs:
23+
gosec:
24+
name: GoSec Security Scan
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Check out code
28+
uses: actions/checkout@v4
29+
30+
- name: Run Gosec Security Scanner
31+
uses: securego/gosec@master
32+
with:
33+
args: ./...
34+
35+
dependency-scan:
36+
name: Dependency Check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Check out code
40+
uses: actions/checkout@v4
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v4
44+
with:
45+
go-version: 1.24.x
46+
47+
- name: Nancy
48+
uses: sonatype-nexus-community/nancy-github-action@main
49+
with:
50+
golist-mod: go list -json -m all

.github/workflows/test.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,4 @@ jobs:
2626
run: go test -v ./...
2727

2828
- name: Run tests with race detection
29-
run: go test -race -v ./...
30-
31-
lint:
32-
name: Lint
33-
runs-on: ubuntu-latest
34-
steps:
35-
- name: Set up Go
36-
uses: actions/setup-go@v4
37-
with:
38-
go-version: 1.24.x
39-
40-
- name: Check out code
41-
uses: actions/checkout@v4
42-
43-
- name: Install golangci-lint
44-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.0
45-
46-
- name: Run golangci-lint
47-
run: $(go env GOPATH)/bin/golangci-lint run -v
29+
run: go test -race -v ./...

scripts/test.sh

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@
77
# -v Verbose mode
88
# -r Run tests with race detection
99
# -c Generate coverage report
10-
# -a Run all checks (equivalent to -v -r -c)
10+
# -l Run linter (currently disabled)
11+
# -a Run all checks (equivalent to -v -r -c -l)
1112

1213
VERBOSE=0
1314
RACE=0
1415
COVERAGE=0
15-
LINT=0
16+
LINT=0 # Linting is disabled until further notice
1617
EXIT_CODE=0
1718

1819
while getopts "vrcla" opt; do
1920
case $opt in
2021
v) VERBOSE=1 ;;
2122
r) RACE=1 ;;
2223
c) COVERAGE=1 ;;
23-
a) VERBOSE=1; RACE=1; COVERAGE=1; LINT=1 ;;
24+
l) echo "Note: Linting is currently disabled until further notice." ;;
25+
a) VERBOSE=1; RACE=1; COVERAGE=1; ;; # LINT=1 removed
2426
*) echo "Invalid option: -$OPTARG" >&2; exit 1 ;;
2527
esac
2628
done
@@ -43,6 +45,54 @@ if [ $VERBOSE -eq 1 ]; then
4345
TEST_FLAGS="-v"
4446
fi
4547

48+
# LINTING FUNCTIONALITY DISABLED UNTIL FURTHER NOTICE
49+
# Run linter if requested
50+
#if [ $LINT -eq 1 ]; then
51+
# echo "=== Running golangci-lint ==="
52+
#
53+
# # Check if golangci-lint is installed
54+
# if ! command -v golangci-lint &> /dev/null; then
55+
# echo "golangci-lint not found, attempting to install..."
56+
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.55.0
57+
#
58+
# # Check if the installation was successful
59+
# if ! command -v "$(go env GOPATH)"/bin/golangci-lint &> /dev/null; then
60+
# echo "ERROR: Failed to install golangci-lint" >&2
61+
# EXIT_CODE=1
62+
# fi
63+
# fi
64+
#
65+
# # Create .golangci.yml file if it doesn't exist
66+
# if [ ! -f .golangci.yml ]; then
67+
# echo "Creating golangci-lint config..."
68+
# cat > .golangci.yml << EOL
69+
#run:
70+
# timeout: 5m
71+
# tests: true
72+
# skip-dirs:
73+
# - internal/parser/gen
74+
#
75+
#linters:
76+
# disable-all: true
77+
# enable:
78+
# - errcheck
79+
# - gosimple
80+
# - govet
81+
# - ineffassign
82+
# - staticcheck
83+
# - unused
84+
#EOL
85+
# fi
86+
#
87+
# # Run golangci-lint
88+
# echo "Running linter..."
89+
# if command -v golangci-lint &> /dev/null; then
90+
# run_test golangci-lint run -v
91+
# else
92+
# run_test "$(go env GOPATH)"/bin/golangci-lint run -v
93+
# fi
94+
#fi
95+
4696
echo "=== Running Go tests ==="
4797
if [ $RACE -eq 1 ]; then
4898
echo "Running tests with race detection..."

0 commit comments

Comments
 (0)