-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔄 synced file(s) with dealroom/core-mothership (#233)
Co-authored-by: dealroomba-app[bot] <189869926+dealroomba-app[bot]@users.noreply.github.com>
- Loading branch information
1 parent
838731d
commit 04a82df
Showing
4 changed files
with
139 additions
and
186 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,125 @@ | ||
# Auto-synced file, managed by [dealroom/core-mothership](https://github.com/dealroom/core-mothership) | ||
# The changes to this file will be automatically overwritten on the next sync. Do not edit by hand! | ||
|
||
name: Setup Linting Process | ||
description: Setup linting process for the repository | ||
inputs: | ||
config-file: | ||
description: Configuration file to use for linting | ||
required: false | ||
default: .github/super-linter.env | ||
external-setup: | ||
description: Run the external setup action (eg. setup-php, setup-node etc.) | ||
required: false | ||
default: false | ||
configure-ignores: | ||
description: Configure ignores specific to linting process | ||
required: false | ||
default: false | ||
extensions: | ||
description: Extra extensions to install | ||
required: false | ||
default: none | ||
github-token: | ||
description: GitHub token to use for pulling private packages | ||
required: false | ||
docs-generate: | ||
description: Generate documentation for TF modules | ||
required: false | ||
default: false | ||
runs: | ||
using: composite | ||
steps: | ||
- if: inputs.external-setup == 'true' | ||
id: check_files | ||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 | ||
with: | ||
files: ./.github/actions/setup/action.yml | ||
- if: inputs.external-setup == 'true' | ||
run: grep -o '^[^#]*' ${{ inputs.config-file }} >> "$GITHUB_ENV" | ||
shell: bash | ||
- uses: ./.github/actions/setup | ||
if: steps.check_files.outputs.files_exists == 'true' | ||
with: | ||
github-token: ${{ inputs.github-token }} | ||
extensions: ${{ inputs.extensions }} | ||
docs-generate: ${{ inputs.docs-generate }} | ||
- if: inputs.configure-ignores == 'true' | ||
shell: bash | ||
run: | | ||
if [ -d ./charts ]; then | ||
if [ -f .prettierignore ]; then | ||
if ! grep -q "charts/" .prettierignore; then | ||
echo "charts/${REPO_NAME}/templates/**/*.yaml" >> .prettierignore | ||
echo "charts/${REPO_NAME}/values/**/*.yaml" >> .prettierignore | ||
fi | ||
else | ||
echo "charts/" > .prettierignore | ||
fi | ||
fi | ||
if [ -f helmfile.yaml ]; then | ||
if [ -f .prettierignore ]; then | ||
if ! grep -q "helmfile.yaml" .prettierignore; then | ||
echo "helmfile.yaml" >> .prettierignore | ||
fi | ||
else | ||
echo "helmfile.yaml" > .prettierignore | ||
fi | ||
fi | ||
env: | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
- if: inputs.configure-ignores == 'true' | ||
shell: bash | ||
run: | | ||
add_prettier_ignore() { | ||
local marker="$1" | ||
local comment="$2" | ||
if [ "$comment" == "prettier-ignore-start" ]; then | ||
find . -type d -name ".terraform" -prune -o -type f -name "README.md" -print0 | \ | ||
xargs -0 sed -i "/<!-- ${marker} -->/!b;/<!-- ${comment} -->/!i <!-- ${comment} -->" | ||
else | ||
find . -type d -name ".terraform" -prune -o -type f -name "README.md" -print0 | \ | ||
xargs -0 sed -i "/<!-- ${marker} -->/!b;/<!-- ${comment} -->/!a <!-- ${comment} -->" | ||
fi | ||
} | ||
ensure_no_duplicates() { | ||
find . -type d -name ".terraform" -prune -o -type f -name "README.md" -print0 | \ | ||
xargs -0 sed -i '/<!-- prettier-ignore-start -->/d; /<!-- prettier-ignore-end -->/d' | ||
} | ||
ensure_no_duplicates | ||
add_prettier_ignore "BEGIN_TF_DOCS" "prettier-ignore-start" | ||
add_prettier_ignore "END_TF_DOCS" "prettier-ignore-end" | ||
- if: inputs.configure-ignores == 'true' | ||
shell: bash | ||
run: | | ||
if [ -f .gitignore ]; then | ||
if ! grep -q "super-linter-output" .gitignore; then | ||
echo "super-linter-output" >> .gitignore | ||
fi | ||
if ! grep -q "super-linter.log" .gitignore; then | ||
echo "super-linter.log" >> .gitignore | ||
fi | ||
if ! grep -q "github_conf" .gitignore; then | ||
echo "github_conf" >> .gitignore | ||
fi | ||
else | ||
echo "super-linter-output" > .gitignore | ||
echo "super-linter.log" >> .gitignore | ||
echo "github_conf" >> .gitignore | ||
fi | ||
- if: inputs.configure-ignores == 'true' | ||
shell: bash | ||
run: | | ||
if [ -d terraform ]; then | ||
if [ -f .gitignore ]; then | ||
if ! grep -qF ".external_modules" .gitignore; then | ||
echo ".external_modules" >> .gitignore | ||
fi | ||
if ! grep -qF "**/.external_modules" .gitignore; then | ||
echo "**/.external_modules" >> .gitignore | ||
fi | ||
else | ||
echo ".external_modules" > .gitignore | ||
echo "**/.external_modules" >> .gitignore | ||
fi | ||
fi |
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
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
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