Skip to content

Merge pull request 'ci: add step to resolve todos' (#19) from ci/todo… #50

Merge pull request 'ci: add step to resolve todos' (#19) from ci/todo…

Merge pull request 'ci: add step to resolve todos' (#19) from ci/todo… #50

Workflow file for this run

name: "Default CI"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
secret-scan:
name: "Secret Scanner (TruffleHog)"
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'stackit-docker' }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: TruffleHog Scan
uses: edplato/trufflehog-actions-scan@master
todo-check:
name: "Check for Open TODOs"
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'stackit-ubuntu-22' }}
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Search codebase
run: |
# Searches recursively (-r), showing line numbers (-n), ignoring binary files (-I)
# Excludes the .git directory to prevent false positives
if grep -rnIE "# ?TODO" --exclude-dir=.git --exclude-dir=.github .; then
echo "Error: TODOs found in the codebase. Please resolve them before merging."
exit 1
fi
echo "No TODOs found. Proceeding."
pre-commit-checks:
name: "Pre-Commit Hooks"
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'stackit-ubuntu-22' }}
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set up Terraform
uses: hashicorp/setup-terraform@v4
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26"
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Install addlicense
# Installs the tool and adds it to the GitHub Actions PATH so pre-commit can find it
run: |
go install github.com/google/addlicense@latest
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Run pre-commit
uses: pre-commit/action@v3.0.1