From b442ea435bb7eb7a9f6375dbb08349736701fa97 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 10 Mar 2025 20:44:35 +0100 Subject: [PATCH 01/56] Add reusable phplinter-workflow --- .github/workflows/phplinter.yml | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/phplinter.yml diff --git a/.github/workflows/phplinter.yml b/.github/workflows/phplinter.yml new file mode 100644 index 0000000..a6536a6 --- /dev/null +++ b/.github/workflows/phplinter.yml @@ -0,0 +1,69 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + php-version: + description: 'The PHP-version to use for linting' + type: string + required: true + repository: + description: 'The repository that needs linting' + type: string + required: false + default: ${{ github.repository }} + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + +env: + supported: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]' + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + - name: Supported version check + if: contains(fromJSON(env.supported), inputs.php-version) == false + run: exit 1 + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Setup PHP runtime + uses: shivammathur/setup-php@v2 + with: + tools: phive + php-version: ${{ inputs.php-version }} + coverage: "none" + + - name: Install overtrue/phplint (v3.4) + if: inputs.php-version == '7.4' + run: | + phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v4.5) + if: inputs.php-version == '8.0' + run: | + phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v9.4) + if: inputs.php-version == '8.1' + run: | + phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v9.5) + if: inputs.php-version != '7.4' && inputs.php-version != '8.0' && inputs.php-version != '8.1' + run: | + phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin + + - name: Lint PHP files + run: | + ./bin/phplint --no-cache --no-progress -v From 35a59d4bb191db9ea85a74168f52f420108a0f31 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 11 Mar 2025 13:47:59 +0100 Subject: [PATCH 02/56] Add reusable yamllinter workflow --- .github/workflows/yamllinter.yml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/yamllinter.yml diff --git a/.github/workflows/yamllinter.yml b/.github/workflows/yamllinter.yml new file mode 100644 index 0000000..028994c --- /dev/null +++ b/.github/workflows/yamllinter.yml @@ -0,0 +1,37 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + repository: + description: 'The repository that needs linting' + type: string + default: ${{ github.repository }} + required: false + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + config_file: + description: 'The location of the linter-configuration' + type: string + required: false + default: '' + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Lint YAML + uses: ibiqlik/action-yamllint@v3.1.1 + with: + config_file: ${{ inputs.config_file }} From e6c590aa99f352fe180c5436bb2751b404a6e8d3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 11 Mar 2025 20:55:51 +0100 Subject: [PATCH 03/56] Add JSON linter --- .github/workflows/jsonlinter.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/jsonlinter.yml diff --git a/.github/workflows/jsonlinter.yml b/.github/workflows/jsonlinter.yml new file mode 100644 index 0000000..082c96a --- /dev/null +++ b/.github/workflows/jsonlinter.yml @@ -0,0 +1,30 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + repository: + description: 'The repository that needs linting' + type: string + default: ${{ github.repository }} + required: false + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Lint JSON + uses: limitusus/json-syntax-check@v2 From 979ae1c4435c624c7251fa6d7d8cc6c36c827094 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 11 Mar 2025 21:26:19 +0100 Subject: [PATCH 04/56] Add eslinter --- .github/workflows/eslinter.yml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/eslinter.yml diff --git a/.github/workflows/eslinter.yml b/.github/workflows/eslinter.yml new file mode 100644 index 0000000..dc4685c --- /dev/null +++ b/.github/workflows/eslinter.yml @@ -0,0 +1,46 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + repository: + description: 'The repository that needs linting' + type: string + default: ${{ github.repository }} + required: false + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + config: + description: 'The location of the configuration file' + type: string + required: false + default: './tools/linters/eslint.config.js' + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + - name: Install NodeJS + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Install ESLint + run: | + npm install eslint eslint-config + + - name: Lint JavaScript + run: ./node_modules/.bin/eslint --config=${{ inputs.config}} + env: + DEBUG: eslint:languages:js From 994c3acc1b3162bd020d758fa0d80758dc28470a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 12 Mar 2025 17:36:35 +0100 Subject: [PATCH 05/56] Add stylelinter --- .github/workflows/stylelinter.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/stylelinter.yml diff --git a/.github/workflows/stylelinter.yml b/.github/workflows/stylelinter.yml new file mode 100644 index 0000000..f66a69f --- /dev/null +++ b/.github/workflows/stylelinter.yml @@ -0,0 +1,44 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + repository: + description: 'The repository that needs linting' + type: string + default: ${{ github.repository }} + required: false + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + pattern: + description: 'The file-pattern to match files that are being linted' + type: string + required: false + default: '**/*.{css,scss,sass}' + config_file: + description: 'The location of the linter-configuration' + type: string + required: false + default: 'tools/linters/.stylelintrc.json' + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Lint stylesheets + uses: actions-hub/stylelint@v1.1.6 + env: + PATTERN: ${{ inputs.pattern }} + INDENT_SPACES: 2 + CONFIG_PATH: ${{ inputs.config_file }} From 4df3c5f67950f69d093d58a44d3fa88b58ea331c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 12 Mar 2025 21:42:35 +0100 Subject: [PATCH 06/56] stylelint config --- .github/workflows/stylelinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stylelinter.yml b/.github/workflows/stylelinter.yml index f66a69f..273ded9 100644 --- a/.github/workflows/stylelinter.yml +++ b/.github/workflows/stylelinter.yml @@ -22,7 +22,7 @@ on: # yamllint disable-line rule:truthy description: 'The location of the linter-configuration' type: string required: false - default: 'tools/linters/.stylelintrc.json' + default: 'tools/linters/' jobs: linter: From a3eb0668e6c641e0cd16280358ae947818caec9c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 12 Mar 2025 21:49:17 +0100 Subject: [PATCH 07/56] Refactor stylelinter --- .github/workflows/eslinter.yml | 2 +- .github/workflows/stylelinter.yml | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/eslinter.yml b/.github/workflows/eslinter.yml index dc4685c..807f46e 100644 --- a/.github/workflows/eslinter.yml +++ b/.github/workflows/eslinter.yml @@ -41,6 +41,6 @@ jobs: npm install eslint eslint-config - name: Lint JavaScript - run: ./node_modules/.bin/eslint --config=${{ inputs.config}} + run: ./node_modules/.bin/eslint --config=${{ inputs.config }} env: DEBUG: eslint:languages:js diff --git a/.github/workflows/stylelinter.yml b/.github/workflows/stylelinter.yml index 273ded9..01061fd 100644 --- a/.github/workflows/stylelinter.yml +++ b/.github/workflows/stylelinter.yml @@ -22,13 +22,18 @@ on: # yamllint disable-line rule:truthy description: 'The location of the linter-configuration' type: string required: false - default: 'tools/linters/' + default: 'tools/linters/.stylelintrc.json' jobs: linter: runs-on: ubuntu-latest steps: + - name: Install NodeJS + uses: actions/setup-node@v4 + with: + node-version: latest + - name: Checkout Code uses: actions/checkout@v4 with: @@ -36,9 +41,8 @@ jobs: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} + - name: Install StyleLint + run: npm install stylelint stylelint-config-standard + - name: Lint stylesheets - uses: actions-hub/stylelint@v1.1.6 - env: - PATTERN: ${{ inputs.pattern }} - INDENT_SPACES: 2 - CONFIG_PATH: ${{ inputs.config_file }} + run: ./node_modules/.bin/stylelint -f verbose -c=${{ inputs.config_file }} ${{ inputs.pattern }} From 1e1875c76a64387ad2a5d9cb9010dd55b74f27ca Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 13 Mar 2025 00:01:10 +0100 Subject: [PATCH 08/56] Add xmllinter --- .github/workflows/xmllinter.yml | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/xmllinter.yml diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml new file mode 100644 index 0000000..7c6aa2d --- /dev/null +++ b/.github/workflows/xmllinter.yml @@ -0,0 +1,65 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + repository: + description: 'The repository that needs linting' + type: string + default: ${{ github.repository }} + required: false + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + config_file: + description: 'The location of the linter-configuration' + type: string + required: false + default: 'tools/linters/xmllinter.json' + workflow_dispatch: + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + #- name: "Read JSON" + # uses: actions/github-script@v6 + # id: check-env + # with: + # result-encoding: string + # script: | + # try { + # const fs = require('fs') + # const jsonString = fs.readFileSync('./xmllint.json') + # var config = JSON.parse(jsonString) + # } catch(err) { + # core.error("Error while reading or parsing the JSON") + # core.setFailed(err) + # } + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Read JSON file # this puts the whole JSON file in the read-json step output + id: read-json + run: | # to read multi-line JSON file and not bother with escaping + if [ -f "${{ inputs.config_file }}" ]; then + echo "config<> $GITHUB_OUTPUT + cat ${{ inputs.config_file }} >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + else + echo "config={}" >> $GITHUB_OUTPUT + fi + + - name: Lint XML + run: | + echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} + echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }} + echo ${{ steps.read-json.outputs.config }} From 34318466ed6b566311ef5d85b0e5a899fa974292 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 20:48:57 +0100 Subject: [PATCH 09/56] xmllinter --- .github/workflows/xmllinter.yml | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 7c6aa2d..451fae8 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -25,21 +25,6 @@ jobs: runs-on: ubuntu-latest steps: - #- name: "Read JSON" - # uses: actions/github-script@v6 - # id: check-env - # with: - # result-encoding: string - # script: | - # try { - # const fs = require('fs') - # const jsonString = fs.readFileSync('./xmllint.json') - # var config = JSON.parse(jsonString) - # } catch(err) { - # core.error("Error while reading or parsing the JSON") - # core.setFailed(err) - # } - - name: Checkout Code uses: actions/checkout@v4 with: @@ -47,9 +32,9 @@ jobs: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} - - name: Read JSON file # this puts the whole JSON file in the read-json step output + - name: Read JSON file # this puts the whole JSON file in the read-json step output id: read-json - run: | # to read multi-line JSON file and not bother with escaping + run: | # to read multi-line JSON file and not bother with escaping if [ -f "${{ inputs.config_file }}" ]; then echo "config<> $GITHUB_OUTPUT cat ${{ inputs.config_file }} >> $GITHUB_OUTPUT @@ -58,8 +43,23 @@ jobs: echo "config={}" >> $GITHUB_OUTPUT fi + - name: Find all XML-files in this repository + id: find-xml + run: | + FILES=`find . -type f -iname "*.xml"` + #if [[ "${FILES}" != "" ]]; then + # JSON=`printf '%s\n' "${FILES[@]}" | jq -R . | jq -s .` + # echo "files=${JSON}" >> $GITHUB_OUTPUT + #else + # echo "files={}" >> $GITHUB_OUTPUT + #fi + echo "files=${FILES}" >> $GITHUB_OUTPUT + - name: Lint XML run: | - echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} - echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }} - echo ${{ steps.read-json.outputs.config }} + #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} + #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }} + for fn in ${{ steps.find-xml.outputs.files }}; do + echo "the next file is $fn" + cat $fn + done From 67aa069c51e03cdea8a9baf37866811b1b5d0265 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 20:56:18 +0100 Subject: [PATCH 10/56] xmllinter --- .github/workflows/xmllinter.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 451fae8..47006d4 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -53,7 +53,9 @@ jobs: #else # echo "files={}" >> $GITHUB_OUTPUT #fi - echo "files=${FILES}" >> $GITHUB_OUTPUT + echo "files<> $GITHUB_OUTPUT + echo "${FILES}" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: Lint XML run: | From 88e78ec8ebb1b1fc3473a602c1ca894f4c500f4d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:05:04 +0100 Subject: [PATCH 11/56] xmllinter --- .github/workflows/xmllinter.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 47006d4..04c26d0 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -56,12 +56,17 @@ jobs: echo "files<> $GITHUB_OUTPUT echo "${FILES}" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT + # iterate through the Bash array + for item in "${FILES[@]}"; do + echo "${item}" + done - name: Lint XML run: | #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }} - for fn in ${{ steps.find-xml.outputs.files }}; do - echo "the next file is $fn" - cat $fn - done + #for fn in ${{ steps.find-xml.outputs.files }}; do + # echo "the next file is $fn" + # cat $fn + #done + From 0ae693ba30c91b43a4d4f73af4feb0c1c503d3ad Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:08:37 +0100 Subject: [PATCH 12/56] bump --- .github/workflows/xmllinter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 04c26d0..a22b978 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,12 +57,12 @@ jobs: echo "${FILES}" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT # iterate through the Bash array - for item in "${FILES[@]}"; do - echo "${item}" - done - name: Lint XML run: | + for item in "${{ steps.find-xml.outputs.files }}"; do + echo "${item}" + done #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }} #for fn in ${{ steps.find-xml.outputs.files }}; do From ce0f11c82694ee8b256d0df212bc229a9c3074b0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:10:03 +0100 Subject: [PATCH 13/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index a22b978..6852c26 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -60,7 +60,7 @@ jobs: - name: Lint XML run: | - for item in "${{ steps.find-xml.outputs.files }}"; do + for item in "${{ steps.find-xml.outputs.files }}[@]"; do echo "${item}" done #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} From 6669865d2c7ee35a81c5d94b767e03944a17031a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:30:16 +0100 Subject: [PATCH 14/56] bump --- .github/workflows/xmllinter.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 6852c26..f8f094c 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -47,6 +47,13 @@ jobs: id: find-xml run: | FILES=`find . -type f -iname "*.xml"` + for item in ${FILES}[@]; do + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, item) }} -eq "true"]; then + echo "Skip" + else + echo "${item}" + fi + done #if [[ "${FILES}" != "" ]]; then # JSON=`printf '%s\n' "${FILES[@]}" | jq -R . | jq -s .` # echo "files=${JSON}" >> $GITHUB_OUTPUT @@ -60,7 +67,8 @@ jobs: - name: Lint XML run: | - for item in "${{ steps.find-xml.outputs.files }}[@]"; do + FILES=${{ steps.read-json.outputs.files }} + for item in ${FILES}[@]; do echo "${item}" done #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} From 87872525b8f12599b49d62478eb54c9f8c66167a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:31:55 +0100 Subject: [PATCH 15/56] bump --- .github/workflows/xmllinter.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index f8f094c..eb3dc5f 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -48,11 +48,11 @@ jobs: run: | FILES=`find . -type f -iname "*.xml"` for item in ${FILES}[@]; do - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, item) }} -eq "true"]; then - echo "Skip" - else + #if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, item) }} -eq "true"]; then + # echo "Skip" + #else echo "${item}" - fi + #fi done #if [[ "${FILES}" != "" ]]; then # JSON=`printf '%s\n' "${FILES[@]}" | jq -R . | jq -s .` From 3a6dd0a3713b5f80334ca0ae4b86e16d2b9e8532 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:35:23 +0100 Subject: [PATCH 16/56] bump --- .github/workflows/xmllinter.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index eb3dc5f..7455457 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -48,12 +48,12 @@ jobs: run: | FILES=`find . -type f -iname "*.xml"` for item in ${FILES}[@]; do - #if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, item) }} -eq "true"]; then - # echo "Skip" - #else - echo "${item}" - #fi + echo "${item}" done + #if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, item) }} -eq "true"]; then + # echo "Skip" + #else + #fi #if [[ "${FILES}" != "" ]]; then # JSON=`printf '%s\n' "${FILES[@]}" | jq -R . | jq -s .` # echo "files=${JSON}" >> $GITHUB_OUTPUT From 117c1c334bb24dd332bcc15ce7a3286e95672c2c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:38:34 +0100 Subject: [PATCH 17/56] bump --- .github/workflows/xmllinter.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 7455457..e740893 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -50,20 +50,10 @@ jobs: for item in ${FILES}[@]; do echo "${item}" done - #if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, item) }} -eq "true"]; then - # echo "Skip" - #else - #fi - #if [[ "${FILES}" != "" ]]; then - # JSON=`printf '%s\n' "${FILES[@]}" | jq -R . | jq -s .` - # echo "files=${JSON}" >> $GITHUB_OUTPUT - #else - # echo "files={}" >> $GITHUB_OUTPUT - #fi + echo "files<> $GITHUB_OUTPUT echo "${FILES}" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - # iterate through the Bash array - name: Lint XML run: | @@ -71,10 +61,3 @@ jobs: for item in ${FILES}[@]; do echo "${item}" done - #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }} - #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }} - #for fn in ${{ steps.find-xml.outputs.files }}; do - # echo "the next file is $fn" - # cat $fn - #done - From b86fc1a9012b835f584e1fab5d57c8491641ee84 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:43:11 +0100 Subject: [PATCH 18/56] bump --- .github/workflows/xmllinter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index e740893..96c41e4 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -47,7 +47,7 @@ jobs: id: find-xml run: | FILES=`find . -type f -iname "*.xml"` - for item in ${FILES}[@]; do + for item in ${FILES}; do echo "${item}" done @@ -58,6 +58,6 @@ jobs: - name: Lint XML run: | FILES=${{ steps.read-json.outputs.files }} - for item in ${FILES}[@]; do + for item in ${FILES}; do echo "${item}" done From bd7e94644a91c919cc8a099ac17f21f302c4688f Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:47:43 +0100 Subject: [PATCH 19/56] bump --- .github/workflows/xmllinter.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 96c41e4..7bbb9a8 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -52,12 +52,13 @@ jobs: done echo "files<> $GITHUB_OUTPUT - echo "${FILES}" >> $GITHUB_OUTPUT + printf '%s\n' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT + #echo "${FILES}" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Lint XML run: | - FILES=${{ steps.read-json.outputs.files }} + FILES=${{ fromJSON(steps.read-json.outputs.files) }} for item in ${FILES}; do echo "${item}" done From 2883091a5d3342f532add4478ec83222d2069c4d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:49:50 +0100 Subject: [PATCH 20/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 7bbb9a8..2d1a10e 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: - name: Lint XML run: | - FILES=${{ fromJSON(steps.read-json.outputs.files) }} + FILES=${{ fromJSON(steps.find-xml.outputs.files) }} for item in ${FILES}; do echo "${item}" done From 4d94716aaaaee71d134797600cb3e70187ac4a22 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:54:20 +0100 Subject: [PATCH 21/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 2d1a10e..7b59c63 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: - name: Lint XML run: | - FILES=${{ fromJSON(steps.find-xml.outputs.files) }} + FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c -r '.[]') for item in ${FILES}; do echo "${item}" done From 02742c110ba3648a9b74c73ffa3928c6f362add7 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 21:57:12 +0100 Subject: [PATCH 22/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 7b59c63..01159dc 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: - name: Lint XML run: | - FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c -r '.[]') + FILES=`echo ${{ steps.find-xml.outputs.files }} | jq -c -r '.[]'` for item in ${FILES}; do echo "${item}" done From 14e8b58b12f9629ade06d9da18d3d884c60d78d9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:07:02 +0100 Subject: [PATCH 23/56] bump --- .github/workflows/xmllinter.yml | 5 +- TEST | 205 ++++++++++++++++++++++++++++++++ 2 files changed, 207 insertions(+), 3 deletions(-) create mode 100644 TEST diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 01159dc..65152bd 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -53,12 +53,11 @@ jobs: echo "files<> $GITHUB_OUTPUT printf '%s\n' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT - #echo "${FILES}" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Lint XML run: | - FILES=`echo ${{ steps.find-xml.outputs.files }} | jq -c -r '.[]'` - for item in ${FILES}; do + FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]') + for item in "${FILES}"; do echo "${item}" done diff --git a/TEST b/TEST new file mode 100644 index 0000000..24881ca --- /dev/null +++ b/TEST @@ -0,0 +1,205 @@ +files< Date: Mon, 17 Mar 2025 22:07:08 +0100 Subject: [PATCH 24/56] bump --- TEST | 205 ----------------------------------------------------------- 1 file changed, 205 deletions(-) delete mode 100644 TEST diff --git a/TEST b/TEST deleted file mode 100644 index 24881ca..0000000 --- a/TEST +++ /dev/null @@ -1,205 +0,0 @@ -files< Date: Mon, 17 Mar 2025 22:12:21 +0100 Subject: [PATCH 25/56] bump --- .github/workflows/xmllinter.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 65152bd..58ae3dc 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,7 +57,10 @@ jobs: - name: Lint XML run: | - FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]') - for item in "${FILES}"; do - echo "${item}" + echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]' | while read i; do + echo ${i} done + #FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]') + #for item in "${FILES}"; do + # echo "${item}" + #done From fb97e0c8766ec7159512d498d967caed25887372 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:20:08 +0100 Subject: [PATCH 26/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 58ae3dc..1eda377 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -52,7 +52,7 @@ jobs: done echo "files<> $GITHUB_OUTPUT - printf '%s\n' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT + printf '%s' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Lint XML From 221654418b06552b034efb5a7b694882945253bc Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:31:29 +0100 Subject: [PATCH 27/56] bump --- .github/workflows/xmllinter.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 1eda377..d780a46 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -51,13 +51,15 @@ jobs: echo "${item}" done - echo "files<> $GITHUB_OUTPUT - printf '%s' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + filelist=`find . -type f -iname "*.xml" | jo -a` + #echo "files<> $GITHUB_OUTPUT + #printf '%s' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT + #echo "EOF" >> $GITHUB_OUTPUT + echo "files=${filelist}" >> $GITHUB_OUTPUT - name: Lint XML run: | - echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]' | while read i; do + echo "${{ steps.find-xml.outputs.filelist }}" | jq -c '.[]' | while read i; do echo ${i} done #FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]') From ac9d21a3d3d2dc362b9327bdbdcfaeced992c142 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:36:01 +0100 Subject: [PATCH 28/56] bump --- .github/workflows/xmllinter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index d780a46..8900c53 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -25,6 +25,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install required tools + run: apt-get -y install jo + - name: Checkout Code uses: actions/checkout@v4 with: From 4f16202aa61c5d6c4ea7a3951b4e5d646165927c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:37:56 +0100 Subject: [PATCH 29/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 8900c53..d61acbb 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Install required tools - run: apt-get -y install jo + run: sudo apt-get -y install jo - name: Checkout Code uses: actions/checkout@v4 From d9d17561993cc748931dfe981e05eb2674b1d6f2 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:40:00 +0100 Subject: [PATCH 30/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index d61acbb..51ba718 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -62,7 +62,7 @@ jobs: - name: Lint XML run: | - echo "${{ steps.find-xml.outputs.filelist }}" | jq -c '.[]' | while read i; do + echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]' | while read i; do echo ${i} done #FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]') From c3d2a9b8a6db9a3be17f058c95712f1856001468 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:50:30 +0100 Subject: [PATCH 31/56] bump --- .github/workflows/xmllinter.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 51ba718..ce7cc98 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -49,23 +49,15 @@ jobs: - name: Find all XML-files in this repository id: find-xml run: | - FILES=`find . -type f -iname "*.xml"` - for item in ${FILES}; do - echo "${item}" - done - filelist=`find . -type f -iname "*.xml" | jo -a` - #echo "files<> $GITHUB_OUTPUT - #printf '%s' "${FILES[@]}" | jq -R . | jq -s . >> $GITHUB_OUTPUT - #echo "EOF" >> $GITHUB_OUTPUT - echo "files=${filelist}" >> $GITHUB_OUTPUT + echo "filelist=${filelist}" >> $GITHUB_OUTPUT - name: Lint XML run: | - echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]' | while read i; do - echo ${i} + echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do + if [ ${{ contains(steps.read-json.outputs.config).ignore, ${i}) }} -eq "true"] + echo "Skipping ${i}" + else + echo "Linting ${i}" + fi done - #FILES=$(echo "${{ steps.find-xml.outputs.files }}" | jq -c '.[]') - #for item in "${FILES}"; do - # echo "${item}" - #done From 37e170907d138ee96b5d34e85777d6ae21e379ee Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:51:58 +0100 Subject: [PATCH 32/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index ce7cc98..85de950 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -55,7 +55,7 @@ jobs: - name: Lint XML run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - if [ ${{ contains(steps.read-json.outputs.config).ignore, ${i}) }} -eq "true"] + if [ ${{ contains(steps.read-json.outputs.config).ignore, i) }} -eq "true"] echo "Skipping ${i}" else echo "Linting ${i}" From bc48fa3cc6400dd95d00da3a6423f37c3e1bbb0b Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 22:56:10 +0100 Subject: [PATCH 33/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 85de950..c78902b 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -55,7 +55,7 @@ jobs: - name: Lint XML run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - if [ ${{ contains(steps.read-json.outputs.config).ignore, i) }} -eq "true"] + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, i) }} -eq "true"] echo "Skipping ${i}" else echo "Linting ${i}" From 219138a8f6e0246fe859e828384efd169e3eb466 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:00:48 +0100 Subject: [PATCH 34/56] bump --- .github/workflows/xmllinter.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index c78902b..e7786c0 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -53,9 +53,12 @@ jobs: echo "filelist=${filelist}" >> $GITHUB_OUTPUT - name: Lint XML + id: linter run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, i) }} -eq "true"] + echo "current_file=${i}" >> $GITHUB_OUTPUT + + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, steps.linter.outputs.current_file) }} -eq "true"] echo "Skipping ${i}" else echo "Linting ${i}" From 30b0af3c6d2bbf3ca13e47cac0c54e32dd6892ed Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:07:18 +0100 Subject: [PATCH 35/56] bump --- .github/workflows/xmllinter.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index e7786c0..e35ace4 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,10 @@ jobs: echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_OUTPUT - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, steps.linter.outputs.current_file) }} -eq "true"] + if [ ${{ contains( + fromJSON(steps.read-json.outputs.config).ignore, + steps.linter.outputs.current_file) }} -eq "true" + ]; then echo "Skipping ${i}" else echo "Linting ${i}" From ba5a909cc3d58fda926ad06249f51f5c7e5f0190 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:19:38 +0100 Subject: [PATCH 36/56] bump --- .github/workflows/xmllinter.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index e35ace4..1a4c2ce 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -56,12 +56,9 @@ jobs: id: linter run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - echo "current_file=${i}" >> $GITHUB_OUTPUT + echo "current_file=${i}" >> $GITHUB_ENV - if [ ${{ contains( - fromJSON(steps.read-json.outputs.config).ignore, - steps.linter.outputs.current_file) }} -eq "true" - ]; then + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} -eq "true" ]; then echo "Skipping ${i}" else echo "Linting ${i}" From 50db3883bb72ee2b30b8f7f7e1149325d2231937 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:24:39 +0100 Subject: [PATCH 37/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 1a4c2ce..04d2a56 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} -eq "true" ]; then + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} = "true" ]; then echo "Skipping ${i}" else echo "Linting ${i}" From 1924c8a2248e98b064975cd3005d78a08de0eb91 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:28:20 +0100 Subject: [PATCH 38/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 04d2a56..8268f11 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} = "true" ]; then + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} ]; then echo "Skipping ${i}" else echo "Linting ${i}" From dec929a66f1d1d7cf9c1bed6859c7df51610af49 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:30:46 +0100 Subject: [PATCH 39/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 8268f11..00a02b8 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} ]; then + if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} = true]; then echo "Skipping ${i}" else echo "Linting ${i}" From 1fd723171efa34ccfaae406e896e317e5c150c51 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:35:06 +0100 Subject: [PATCH 40/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 00a02b8..66b04b7 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV - if [ ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} = true]; then + if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }}" = "true" ]; then echo "Skipping ${i}" else echo "Linting ${i}" From 73dcf82085923cef7c26a04164f022bcc65b7e54 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:38:21 +0100 Subject: [PATCH 41/56] bump --- .github/workflows/xmllinter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 66b04b7..d41635e 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,6 +57,7 @@ jobs: run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV + echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }}" = "true" ]; then echo "Skipping ${i}" From bd603d136a64bceb764cc6d95b66701b00f033bf Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:40:48 +0100 Subject: [PATCH 42/56] bump --- .github/workflows/xmllinter.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index d41635e..30d1372 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,7 +57,9 @@ jobs: run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV - echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }} + echo ${{ steps.read-json.outputs.config }} + echo ${{ env.current_file }} + echo ${{ vars.current_file }} if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }}" = "true" ]; then echo "Skipping ${i}" From ad625bee4381956d0a127a2fc6a556e5cb27ad6c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:43:24 +0100 Subject: [PATCH 43/56] bump --- .github/workflows/xmllinter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 30d1372..f51d756 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,9 +57,9 @@ jobs: run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> $GITHUB_ENV - echo ${{ steps.read-json.outputs.config }} - echo ${{ env.current_file }} - echo ${{ vars.current_file }} + echo "${{ steps.read-json.outputs.config }}" + echo "${{ env.current_file }}" + echo "${{ vars.current_file }}" if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }}" = "true" ]; then echo "Skipping ${i}" From f38df695ba4626b366e644fc71ff519d222b4827 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 17 Mar 2025 23:55:42 +0100 Subject: [PATCH 44/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index f51d756..acc882a 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -56,7 +56,7 @@ jobs: id: linter run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - echo "current_file=${i}" >> $GITHUB_ENV + echo "current_file=${i}" >> "$GITHUB_ENV" echo "${{ steps.read-json.outputs.config }}" echo "${{ env.current_file }}" echo "${{ vars.current_file }}" From 4aef55eb227e4f3ed59fda6e71f5c0e452c269c9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:03:44 +0100 Subject: [PATCH 45/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index acc882a..63b1305 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -61,7 +61,7 @@ jobs: echo "${{ env.current_file }}" echo "${{ vars.current_file }}" - if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, env.current_file) }}" = "true" ]; then + if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, `echo current_file`) }}" = "true" ]; then echo "Skipping ${i}" else echo "Linting ${i}" From 575267fa64a2fca72ee75a1c3c1d158c1d522289 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:18:28 +0100 Subject: [PATCH 46/56] bump --- .github/workflows/xmllinter.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 63b1305..b3cb61c 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,11 +57,9 @@ jobs: run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> "$GITHUB_ENV" - echo "${{ steps.read-json.outputs.config }}" - echo "${{ env.current_file }}" - echo "${{ vars.current_file }}" - if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, `echo current_file`) }}" = "true" ]; then + echo jq --null-input '${{ steps.find-xml.outputs.filelist }} - ${{ fromJSON(steps.read-json.outputs.config).ignore }}' + if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, './phpcs.xml') }}" = "true" ]; then echo "Skipping ${i}" else echo "Linting ${i}" From b230db43fdb9fd35bc91dcd4a783be3d6c2d3ed9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:32:57 +0100 Subject: [PATCH 47/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index b3cb61c..474ada3 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -58,7 +58,7 @@ jobs: echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> "$GITHUB_ENV" - echo jq --null-input '${{ steps.find-xml.outputs.filelist }} - ${{ fromJSON(steps.read-json.outputs.config).ignore }}' + echo jq --null-input '${{ steps.find-xml.outputs.filelist }} - ${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, './phpcs.xml') }}" = "true" ]; then echo "Skipping ${i}" else From 09f810975c2a9df1b75db3b913eaa96d1d5a322e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:41:29 +0100 Subject: [PATCH 48/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 474ada3..4150020 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -57,7 +57,7 @@ jobs: run: | echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> "$GITHUB_ENV" - + echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.[]' echo jq --null-input '${{ steps.find-xml.outputs.filelist }} - ${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, './phpcs.xml') }}" = "true" ]; then echo "Skipping ${i}" From d2a05482436affd90bba70f86ce3d3918657df99 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:44:17 +0100 Subject: [PATCH 49/56] bump --- .github/workflows/xmllinter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 4150020..a19fbb9 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -55,9 +55,10 @@ jobs: - name: Lint XML id: linter run: | + echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.[]' + echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> "$GITHUB_ENV" - echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.[]' echo jq --null-input '${{ steps.find-xml.outputs.filelist }} - ${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, './phpcs.xml') }}" = "true" ]; then echo "Skipping ${i}" From a3c79a87f23748dc04ed4453fa402f61e7f72c82 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:45:34 +0100 Subject: [PATCH 50/56] bump --- .github/workflows/xmllinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index a19fbb9..52e3325 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -55,7 +55,7 @@ jobs: - name: Lint XML id: linter run: | - echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.[]' + echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.' echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do echo "current_file=${i}" >> "$GITHUB_ENV" From eb0b19c546ea34771f452204b2a44e0e459796aa Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 18 Mar 2025 00:49:44 +0100 Subject: [PATCH 51/56] bump --- .github/workflows/xmllinter.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index 52e3325..d25c063 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -46,6 +46,12 @@ jobs: echo "config={}" >> $GITHUB_OUTPUT fi + - name: Substract ignore-list from config + id: read-ignore + run: | + IGNORE=`echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.'` + echo "ignore=${IGNORE}" >> $GITHUB_OUTPUT + - name: Find all XML-files in this repository id: find-xml run: | @@ -55,12 +61,11 @@ jobs: - name: Lint XML id: linter run: | - echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.' echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - echo "current_file=${i}" >> "$GITHUB_ENV" - echo jq --null-input '${{ steps.find-xml.outputs.filelist }} - ${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' - if [ "${{ contains(fromJSON(steps.read-json.outputs.config).ignore, './phpcs.xml') }}" = "true" ]; then + ignore=`jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}'` + + if [ "$ignore" = "[]" ]; then echo "Skipping ${i}" else echo "Linting ${i}" From 6de2df78313b5fd707c8e01484ca34a40f0276db Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 23 Mar 2025 21:36:38 +0100 Subject: [PATCH 52/56] Fix linter-issues --- .github/workflows/xmllinter.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index d25c063..cef011d 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -39,31 +39,33 @@ jobs: id: read-json run: | # to read multi-line JSON file and not bother with escaping if [ -f "${{ inputs.config_file }}" ]; then - echo "config<> $GITHUB_OUTPUT - cat ${{ inputs.config_file }} >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + { + echo "config<> "$GITHUB_OUTPUT" else - echo "config={}" >> $GITHUB_OUTPUT + echo "config={}" >> "$GITHUB_OUTPUT" fi - name: Substract ignore-list from config id: read-ignore run: | - IGNORE=`echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.'` - echo "ignore=${IGNORE}" >> $GITHUB_OUTPUT + IGNORE="$(echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.')" + echo "ignore=${IGNORE}" >> "$GITHUB_OUTPUT" - name: Find all XML-files in this repository id: find-xml run: | - filelist=`find . -type f -iname "*.xml" | jo -a` - echo "filelist=${filelist}" >> $GITHUB_OUTPUT + filelist="$(find . -type f -iname "*.xml" | jo -a)" + echo "filelist=${filelist}" >> "$GITHUB_OUTPUT" - name: Lint XML id: linter run: | - - echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read i; do - ignore=`jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}'` + echo $("${{ steps.find-xml.outputs.filelist }}") | jq -c '.[]' | while read i; do + ignore="$(jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}')" + echo "$(jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}')" if [ "$ignore" = "[]" ]; then echo "Skipping ${i}" From e571d8def71eb64bb4df59e81374969445cebf60 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Mon, 24 Mar 2025 09:41:32 +0100 Subject: [PATCH 53/56] fix linter --- .github/workflows/xmllinter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml index cef011d..3b6aa02 100644 --- a/.github/workflows/xmllinter.yml +++ b/.github/workflows/xmllinter.yml @@ -63,9 +63,9 @@ jobs: - name: Lint XML id: linter run: | - echo $("${{ steps.find-xml.outputs.filelist }}") | jq -c '.[]' | while read i; do - ignore="$(jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}')" - echo "$(jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}')" + echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read -r i; do + ignore=$(jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}') + echo "$ignore" if [ "$ignore" = "[]" ]; then echo "Skipping ${i}" From 2f8980a72346dd91d9d6b2adc89e589dc1736238 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 27 Mar 2025 22:34:29 +0100 Subject: [PATCH 54/56] Drop xmllinter, rename to reusable_* --- .../{eslinter.yml => reusable_eslinter.yml} | 0 ...jsonlinter.yml => reusable_jsonlinter.yml} | 0 .../{phplinter.yml => reusable_phplinter.yml} | 0 ...ylelinter.yml => reusable_stylelinter.yml} | 0 ...yamllinter.yml => reusable_yamllinter.yml} | 0 .github/workflows/xmllinter.yml | 75 ------------------- 6 files changed, 75 deletions(-) rename .github/workflows/{eslinter.yml => reusable_eslinter.yml} (100%) rename .github/workflows/{jsonlinter.yml => reusable_jsonlinter.yml} (100%) rename .github/workflows/{phplinter.yml => reusable_phplinter.yml} (100%) rename .github/workflows/{stylelinter.yml => reusable_stylelinter.yml} (100%) rename .github/workflows/{yamllinter.yml => reusable_yamllinter.yml} (100%) delete mode 100644 .github/workflows/xmllinter.yml diff --git a/.github/workflows/eslinter.yml b/.github/workflows/reusable_eslinter.yml similarity index 100% rename from .github/workflows/eslinter.yml rename to .github/workflows/reusable_eslinter.yml diff --git a/.github/workflows/jsonlinter.yml b/.github/workflows/reusable_jsonlinter.yml similarity index 100% rename from .github/workflows/jsonlinter.yml rename to .github/workflows/reusable_jsonlinter.yml diff --git a/.github/workflows/phplinter.yml b/.github/workflows/reusable_phplinter.yml similarity index 100% rename from .github/workflows/phplinter.yml rename to .github/workflows/reusable_phplinter.yml diff --git a/.github/workflows/stylelinter.yml b/.github/workflows/reusable_stylelinter.yml similarity index 100% rename from .github/workflows/stylelinter.yml rename to .github/workflows/reusable_stylelinter.yml diff --git a/.github/workflows/yamllinter.yml b/.github/workflows/reusable_yamllinter.yml similarity index 100% rename from .github/workflows/yamllinter.yml rename to .github/workflows/reusable_yamllinter.yml diff --git a/.github/workflows/xmllinter.yml b/.github/workflows/xmllinter.yml deleted file mode 100644 index 3b6aa02..0000000 --- a/.github/workflows/xmllinter.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - workflow_call: - inputs: - repository: - description: 'The repository that needs linting' - type: string - default: ${{ github.repository }} - required: false - ref: - description: 'The branch, tag or SHA that needs linting' - type: string - required: false - default: ${{ github.ref }} - config_file: - description: 'The location of the linter-configuration' - type: string - required: false - default: 'tools/linters/xmllinter.json' - workflow_dispatch: - -jobs: - linter: - runs-on: ubuntu-latest - - steps: - - name: Install required tools - run: sudo apt-get -y install jo - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Read JSON file # this puts the whole JSON file in the read-json step output - id: read-json - run: | # to read multi-line JSON file and not bother with escaping - if [ -f "${{ inputs.config_file }}" ]; then - { - echo "config<> "$GITHUB_OUTPUT" - else - echo "config={}" >> "$GITHUB_OUTPUT" - fi - - - name: Substract ignore-list from config - id: read-ignore - run: | - IGNORE="$(echo '${{ toJSON(fromJSON(steps.read-json.outputs.config).ignore) }}' | jq -c '.')" - echo "ignore=${IGNORE}" >> "$GITHUB_OUTPUT" - - - name: Find all XML-files in this repository - id: find-xml - run: | - filelist="$(find . -type f -iname "*.xml" | jo -a)" - echo "filelist=${filelist}" >> "$GITHUB_OUTPUT" - - - name: Lint XML - id: linter - run: | - echo '${{ steps.find-xml.outputs.filelist }}' | jq -c '.[]' | while read -r i; do - ignore=$(jq --null-input '["${i}"] - ${{ steps.read-ignore.outputs.ignore }}') - echo "$ignore" - - if [ "$ignore" = "[]" ]; then - echo "Skipping ${i}" - else - echo "Linting ${i}" - fi - done From 3d8f866c947fe1955173129c2021281e47002d61 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 2 Apr 2025 23:01:32 +0200 Subject: [PATCH 55/56] Refactor: merge reusable workflows --- .github/workflows/reusable_eslinter.yml | 46 ----- .github/workflows/reusable_jsonlinter.yml | 30 --- .github/workflows/reusable_linter.yml | 212 +++++++++++++++++++++ .github/workflows/reusable_phplinter.yml | 69 ------- .github/workflows/reusable_stylelinter.yml | 48 ----- .github/workflows/reusable_yamllinter.yml | 37 ---- 6 files changed, 212 insertions(+), 230 deletions(-) delete mode 100644 .github/workflows/reusable_eslinter.yml delete mode 100644 .github/workflows/reusable_jsonlinter.yml create mode 100644 .github/workflows/reusable_linter.yml delete mode 100644 .github/workflows/reusable_phplinter.yml delete mode 100644 .github/workflows/reusable_stylelinter.yml delete mode 100644 .github/workflows/reusable_yamllinter.yml diff --git a/.github/workflows/reusable_eslinter.yml b/.github/workflows/reusable_eslinter.yml deleted file mode 100644 index 807f46e..0000000 --- a/.github/workflows/reusable_eslinter.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - workflow_call: - inputs: - repository: - description: 'The repository that needs linting' - type: string - default: ${{ github.repository }} - required: false - ref: - description: 'The branch, tag or SHA that needs linting' - type: string - required: false - default: ${{ github.ref }} - config: - description: 'The location of the configuration file' - type: string - required: false - default: './tools/linters/eslint.config.js' - -jobs: - linter: - runs-on: ubuntu-latest - - steps: - - name: Install NodeJS - uses: actions/setup-node@v4 - with: - node-version: latest - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Install ESLint - run: | - npm install eslint eslint-config - - - name: Lint JavaScript - run: ./node_modules/.bin/eslint --config=${{ inputs.config }} - env: - DEBUG: eslint:languages:js diff --git a/.github/workflows/reusable_jsonlinter.yml b/.github/workflows/reusable_jsonlinter.yml deleted file mode 100644 index 082c96a..0000000 --- a/.github/workflows/reusable_jsonlinter.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - workflow_call: - inputs: - repository: - description: 'The repository that needs linting' - type: string - default: ${{ github.repository }} - required: false - ref: - description: 'The branch, tag or SHA that needs linting' - type: string - required: false - default: ${{ github.ref }} - -jobs: - linter: - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Lint JSON - uses: limitusus/json-syntax-check@v2 diff --git a/.github/workflows/reusable_linter.yml b/.github/workflows/reusable_linter.yml new file mode 100644 index 0000000..dafffc1 --- /dev/null +++ b/.github/workflows/reusable_linter.yml @@ -0,0 +1,212 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + enable_phplinter: + description: 'Enable the PHP-Linter for this repository' + type: boolean + required: false + default: false + phplinter-versions: + description: 'The PHP-version to use for linting' + type: string + required: false + default: '["8.1", "8.2", "8.3", "8.4"]' + + enable_eslinter: + description: 'Enable the ES-Linter for this repository' + type: boolean + required: false + default: false + eslinter-config: + description: 'The location of the configuration file' + type: string + required: false + default: './tools/linters/eslint.config.js' + + enable_jsonlinter: + description: 'Enable the JSON-Linter for this repository' + type: boolean + required: false + default: false + + enable_yamllinter: + description: 'Enable the YAML-Linter for this repository' + type: boolean + required: false + default: false + yamllinter-config: + description: 'The location of the linter-configuration' + type: string + required: false + default: './tools/linters/.yaml-lint.yml' + + enable_stylelinter: + description: 'Enable the Style-Linter for this repository' + type: boolean + required: false + default: false + stylelinter-pattern: + description: 'The file-pattern to match files that are being linted' + type: string + required: false + default: '**/*.{css,scss,sass}' + stylelinter-config: + description: 'The location of the linter-configuration' + type: string + required: false + default: 'tools/linters/.stylelintrc.json' + + repository: + description: 'The repository that needs linting' + type: string + default: ${{ github.repository }} + required: false + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + +env: + php_supported_versions: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]' + +jobs: + phplinter: + if: inputs.enable_phplinter == true + runs-on: ubuntu-latest + + strategy: + matrix: + php_version: ${{ fromJSON(inputs.phplinter-versions) }} + + steps: + - name: Supported version check + if: contains(fromJSON(env.php_supported_versions), matrix.php_version) == false + run: exit 1 + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Setup PHP runtime + uses: shivammathur/setup-php@v2 + with: + tools: phive + php-version: ${{ matrix.php_version }} + coverage: "none" + + - name: Install overtrue/phplint (v3.4) + if: matrix.php_version == '7.4' + run: | + phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v4.5) + if: matrix.php_version == '8.0' + run: | + phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v9.4) + if: matrix.php_version == '8.1' + run: | + phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v9.5) + if: | + matrix.php_version != '7.4' + && matrix.php_version != '8.0' + && matrix.php_version != '8.1' + run: | + phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin + + - name: Lint PHP files + run: | + ./bin/phplint --no-cache --no-progress -v + + ecmascript-linter: + if: inputs.enable_eslinter == true + runs-on: ubuntu-latest + + steps: + - name: Install NodeJS + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Install ESLint + run: | + npm install eslint eslint-config + + - name: Lint JavaScript + run: ./node_modules/.bin/eslint --config=${{ inputs.eslinter-config }} + env: + DEBUG: eslint:languages:js + + json-linter: + if: inputs.enable_jsonlinter == true + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Lint JSON + uses: limitusus/json-syntax-check@v2 + + style-linter: + if: inputs.enable_stylelinter == true + runs-on: ubuntu-latest + + steps: + - name: Install NodeJS + uses: actions/setup-node@v4 + with: + node-version: latest + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Install StyleLint + run: npm install stylelint stylelint-config-standard + + - name: Lint stylesheets + run: | + ./node_modules/.bin/stylelint \ + -f verbose \ + -c=${{ inputs.stylelinter-config }} ${{ inputs.stylelinter-pattern }} + + yaml-linter: + if: inputs.enable_yamllinter == true + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Lint YAML + uses: ibiqlik/action-yamllint@v3.1.1 + with: + config_file: ${{ inputs.yamllinter-config }} diff --git a/.github/workflows/reusable_phplinter.yml b/.github/workflows/reusable_phplinter.yml deleted file mode 100644 index a6536a6..0000000 --- a/.github/workflows/reusable_phplinter.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - workflow_call: - inputs: - php-version: - description: 'The PHP-version to use for linting' - type: string - required: true - repository: - description: 'The repository that needs linting' - type: string - required: false - default: ${{ github.repository }} - ref: - description: 'The branch, tag or SHA that needs linting' - type: string - required: false - default: ${{ github.ref }} - -env: - supported: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]' - -jobs: - linter: - runs-on: ubuntu-latest - - steps: - - name: Supported version check - if: contains(fromJSON(env.supported), inputs.php-version) == false - run: exit 1 - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Setup PHP runtime - uses: shivammathur/setup-php@v2 - with: - tools: phive - php-version: ${{ inputs.php-version }} - coverage: "none" - - - name: Install overtrue/phplint (v3.4) - if: inputs.php-version == '7.4' - run: | - phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin - - - name: Install overtrue/phplint (v4.5) - if: inputs.php-version == '8.0' - run: | - phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin - - - name: Install overtrue/phplint (v9.4) - if: inputs.php-version == '8.1' - run: | - phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin - - - name: Install overtrue/phplint (v9.5) - if: inputs.php-version != '7.4' && inputs.php-version != '8.0' && inputs.php-version != '8.1' - run: | - phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin - - - name: Lint PHP files - run: | - ./bin/phplint --no-cache --no-progress -v diff --git a/.github/workflows/reusable_stylelinter.yml b/.github/workflows/reusable_stylelinter.yml deleted file mode 100644 index 01061fd..0000000 --- a/.github/workflows/reusable_stylelinter.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - workflow_call: - inputs: - repository: - description: 'The repository that needs linting' - type: string - default: ${{ github.repository }} - required: false - ref: - description: 'The branch, tag or SHA that needs linting' - type: string - required: false - default: ${{ github.ref }} - pattern: - description: 'The file-pattern to match files that are being linted' - type: string - required: false - default: '**/*.{css,scss,sass}' - config_file: - description: 'The location of the linter-configuration' - type: string - required: false - default: 'tools/linters/.stylelintrc.json' - -jobs: - linter: - runs-on: ubuntu-latest - - steps: - - name: Install NodeJS - uses: actions/setup-node@v4 - with: - node-version: latest - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Install StyleLint - run: npm install stylelint stylelint-config-standard - - - name: Lint stylesheets - run: ./node_modules/.bin/stylelint -f verbose -c=${{ inputs.config_file }} ${{ inputs.pattern }} diff --git a/.github/workflows/reusable_yamllinter.yml b/.github/workflows/reusable_yamllinter.yml deleted file mode 100644 index 028994c..0000000 --- a/.github/workflows/reusable_yamllinter.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- - -on: # yamllint disable-line rule:truthy - workflow_call: - inputs: - repository: - description: 'The repository that needs linting' - type: string - default: ${{ github.repository }} - required: false - ref: - description: 'The branch, tag or SHA that needs linting' - type: string - required: false - default: ${{ github.ref }} - config_file: - description: 'The location of the linter-configuration' - type: string - required: false - default: '' - -jobs: - linter: - runs-on: ubuntu-latest - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Lint YAML - uses: ibiqlik/action-yamllint@v3.1.1 - with: - config_file: ${{ inputs.config_file }} From 5bf3ffe7bccdd5872977bf154a1ebd87c61f2c8e Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 4 Apr 2025 23:57:53 +0200 Subject: [PATCH 56/56] Refactor --- .github/workflows/reusable_linter.yml | 68 ----------------------- .github/workflows/reusable_phplinter.yml | 69 ++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/reusable_phplinter.yml diff --git a/.github/workflows/reusable_linter.yml b/.github/workflows/reusable_linter.yml index dafffc1..17b87bb 100644 --- a/.github/workflows/reusable_linter.yml +++ b/.github/workflows/reusable_linter.yml @@ -3,17 +3,6 @@ on: # yamllint disable-line rule:truthy workflow_call: inputs: - enable_phplinter: - description: 'Enable the PHP-Linter for this repository' - type: boolean - required: false - default: false - phplinter-versions: - description: 'The PHP-version to use for linting' - type: string - required: false - default: '["8.1", "8.2", "8.3", "8.4"]' - enable_eslinter: description: 'Enable the ES-Linter for this repository' type: boolean @@ -69,64 +58,7 @@ on: # yamllint disable-line rule:truthy required: false default: ${{ github.ref }} -env: - php_supported_versions: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]' - jobs: - phplinter: - if: inputs.enable_phplinter == true - runs-on: ubuntu-latest - - strategy: - matrix: - php_version: ${{ fromJSON(inputs.phplinter-versions) }} - - steps: - - name: Supported version check - if: contains(fromJSON(env.php_supported_versions), matrix.php_version) == false - run: exit 1 - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - repository: ${{ inputs.repository }} - ref: ${{ inputs.ref }} - - - name: Setup PHP runtime - uses: shivammathur/setup-php@v2 - with: - tools: phive - php-version: ${{ matrix.php_version }} - coverage: "none" - - - name: Install overtrue/phplint (v3.4) - if: matrix.php_version == '7.4' - run: | - phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin - - - name: Install overtrue/phplint (v4.5) - if: matrix.php_version == '8.0' - run: | - phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin - - - name: Install overtrue/phplint (v9.4) - if: matrix.php_version == '8.1' - run: | - phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin - - - name: Install overtrue/phplint (v9.5) - if: | - matrix.php_version != '7.4' - && matrix.php_version != '8.0' - && matrix.php_version != '8.1' - run: | - phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin - - - name: Lint PHP files - run: | - ./bin/phplint --no-cache --no-progress -v - ecmascript-linter: if: inputs.enable_eslinter == true runs-on: ubuntu-latest diff --git a/.github/workflows/reusable_phplinter.yml b/.github/workflows/reusable_phplinter.yml new file mode 100644 index 0000000..a6536a6 --- /dev/null +++ b/.github/workflows/reusable_phplinter.yml @@ -0,0 +1,69 @@ +--- + +on: # yamllint disable-line rule:truthy + workflow_call: + inputs: + php-version: + description: 'The PHP-version to use for linting' + type: string + required: true + repository: + description: 'The repository that needs linting' + type: string + required: false + default: ${{ github.repository }} + ref: + description: 'The branch, tag or SHA that needs linting' + type: string + required: false + default: ${{ github.ref }} + +env: + supported: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]' + +jobs: + linter: + runs-on: ubuntu-latest + + steps: + - name: Supported version check + if: contains(fromJSON(env.supported), inputs.php-version) == false + run: exit 1 + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + repository: ${{ inputs.repository }} + ref: ${{ inputs.ref }} + + - name: Setup PHP runtime + uses: shivammathur/setup-php@v2 + with: + tools: phive + php-version: ${{ inputs.php-version }} + coverage: "none" + + - name: Install overtrue/phplint (v3.4) + if: inputs.php-version == '7.4' + run: | + phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v4.5) + if: inputs.php-version == '8.0' + run: | + phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v9.4) + if: inputs.php-version == '8.1' + run: | + phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin + + - name: Install overtrue/phplint (v9.5) + if: inputs.php-version != '7.4' && inputs.php-version != '8.0' && inputs.php-version != '8.1' + run: | + phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin + + - name: Lint PHP files + run: | + ./bin/phplint --no-cache --no-progress -v