From c1a2d3c2b5eda80691023276ad8f2e6bf99e975f Mon Sep 17 00:00:00 2001 From: Peter Adams Date: Thu, 24 Oct 2024 16:13:20 +0100 Subject: [PATCH] Allow yamllint config to be overridden Motivation: Gives more flexibility to workflow users. Modifications: Copy the pattern from pythonlint to yamllint Result: Option to override yamllint config --- .github/workflows/soundness.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/soundness.yml b/.github/workflows/soundness.yml index 0de2761..5c18dd8 100644 --- a/.github/workflows/soundness.yml +++ b/.github/workflows/soundness.yml @@ -211,8 +211,12 @@ jobs: - name: Run yamllint run: | which yamllint >/dev/null || ( apt-get update && apt-get install -y yamllint ) - curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/configs/yamllint.yml > /tmp/yamllint.yml - yamllint --strict --config-file /tmp/yamllint.yml ${GITHUB_WORKSPACE} + cd ${GITHUB_WORKSPACE} + if [ ! -f ".yamllint.yml" ]; then + echo "Downloading default yamllint config file" + curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/configs/yamllint.yml > .yamllint.yml + fi + yamllint --strict --config-file .yamllint.yml . python-lint-check: name: Python lint check if: ${{ inputs.python_lint_check_enabled }}