ci: rework workflow for Gitea Actions (M0.2)
Switches commitlint to bash regex, gitleaks to inline binary, trivy to inline binary (v0.70.0). Per-stack jobs gated on hashFiles. Refs: M0.2
This commit was merged in pull request #2.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# CI for orca-platform (IaC). Runs `orca validate` only.
|
# CI for orca-platform (IaC). `shared` always runs; `validate` activates
|
||||||
|
# when at least one Orca manifest lands.
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -16,13 +17,47 @@ jobs:
|
|||||||
|
|
||||||
- name: commitlint (PR only)
|
- name: commitlint (PR only)
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: wagoid/commitlint-github-action@v6
|
shell: bash
|
||||||
|
env:
|
||||||
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||||
|
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
pattern='^(feat|fix|docs|chore|refactor|test|perf|build|ci|revert)(\([a-z0-9_/.-]+\))?!?: .{1,72}$'
|
||||||
|
bad=0
|
||||||
|
while IFS= read -r subject; do
|
||||||
|
if ! [[ "$subject" =~ $pattern ]]; then
|
||||||
|
echo "::error::Commit subject does not match Conventional Commits: $subject"
|
||||||
|
bad=$((bad+1))
|
||||||
|
fi
|
||||||
|
done < <(git log --format=%s "${BASE_SHA}..${HEAD_SHA}")
|
||||||
|
if [ "$bad" -gt 0 ]; then
|
||||||
|
echo "::error::$bad commit(s) failed commitlint."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "commitlint: OK"
|
||||||
|
|
||||||
- name: gitleaks
|
- name: gitleaks
|
||||||
uses: gitleaks/gitleaks-action@v2
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
GL_VERSION=8.18.4
|
||||||
|
curl -fsSL "https://github.com/gitleaks/gitleaks/releases/download/v${GL_VERSION}/gitleaks_${GL_VERSION}_linux_x64.tar.gz" \
|
||||||
|
| tar -xz -C /tmp gitleaks
|
||||||
|
/tmp/gitleaks detect --source . --no-banner --redact --verbose --exit-code 1
|
||||||
|
|
||||||
|
- name: trivy fs scan
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
TRIVY_VERSION=0.70.0
|
||||||
|
curl -fsSL "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" \
|
||||||
|
| tar -xz -C /tmp trivy
|
||||||
|
/tmp/trivy fs --severity HIGH,CRITICAL --exit-code 1 --no-progress --skip-dirs node_modules,target,dist .
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
if: hashFiles('**/*.orca.yaml','**/*.orca.yml','manifests/**') != ''
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Generated section is appended on release tag via `git-cliff` (see `.gitea/workfl
|
|||||||
-
|
-
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- ci: rework workflow for Gitea Actions (bash commitlint, inline gitleaks binary, per-stack jobs gated on real code)
|
||||||
-
|
-
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|||||||
Reference in New Issue
Block a user