This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(commit-lint): provide conventional config as baseline with reason…
…able fetch depth
- Loading branch information
Showing
3 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["@commitlint/config-conventional"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,13 @@ name: Source Protection | |
on: | ||
workflow_call: | ||
inputs: | ||
# <--------------- GENERAL OPTIONS -----------------> | ||
# Used for both gitleaks and commit lint and should be set reasonably high | ||
fetch-depth: | ||
required: false | ||
type: string | ||
description: "How many commits to fetch from the repo. Set to 0 for all (slow!) - but at least a minimum of 2" | ||
default: '50' | ||
# <---------- CREDENTIAL SCANNING OPTIONS ----------> | ||
creds-scan-directory: | ||
required: false | ||
|
@@ -13,11 +20,6 @@ on: | |
type: boolean | ||
description: "Defaults to failing the job if tests do not pass. Set to false for the opposite (yet not recommended!) behaviour" | ||
default: true | ||
creds-fetch-depth: | ||
required: false | ||
type: string | ||
description: "How many commits to fetch from the repo. Set to 0 for all (slow!) - but at least a minimum of 2" | ||
default: '50' | ||
creds-gitleaks-config: | ||
required: false | ||
type: string | ||
|
@@ -38,7 +40,7 @@ on: | |
required: false | ||
type: string | ||
description: "Relative path to your own configuration for commit lint if not using the default." | ||
default: '.commitlint.config.js' | ||
default: '.commitlintrc.json' | ||
commits-fail-build: | ||
required: false | ||
type: boolean | ||
|
@@ -66,7 +68,7 @@ jobs: | |
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: ${{ inputs.creds-fetch-depth }} | ||
fetch-depth: ${{ inputs.fetch-depth }} | ||
|
||
- name: gitleaks | ||
uses: zricethezav/[email protected] | ||
|
@@ -81,12 +83,14 @@ jobs: | |
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: ${{ inputs.fetch-depth }} | ||
|
||
- name: Get Configuration | ||
if: ${{ inputs.commits-default-config }} | ||
run: | | ||
echo "Fetching default configuration from erzz/workflows..." | ||
curl -L --fail -o .commitlint.config.js https://raw.githubusercontent.com/erzz/workflows/main/.github/workflows/configs/.commitlint.config.js || exit 1 | ||
curl -L --fail -o .commitlintrc.json https://raw.githubusercontent.com/erzz/workflows/main/.github/workflows/configs/.commitlintrc.json || exit 1 | ||
- uses: wagoid/commitlint-github-action@v4 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters