@@ -25,31 +25,16 @@ jobs:
2525 runs-on : ubuntu-latest
2626
2727 steps :
28- # - name: "Read JSON"
29- # uses: actions/github-script@v6
30- # id: check-env
31- # with:
32- # result-encoding: string
33- # script: |
34- # try {
35- # const fs = require('fs')
36- # const jsonString = fs.readFileSync('./xmllint.json')
37- # var config = JSON.parse(jsonString)
38- # } catch(err) {
39- # core.error("Error while reading or parsing the JSON")
40- # core.setFailed(err)
41- # }
42-
4328 - name : Checkout Code
4429 uses : actions/checkout@v4
4530 with :
4631 fetch-depth : 0
4732 repository : ${{ inputs.repository }}
4833 ref : ${{ inputs.ref }}
4934
50- - name : Read JSON file # this puts the whole JSON file in the read-json step output
35+ - name : Read JSON file # this puts the whole JSON file in the read-json step output
5136 id : read-json
52- run : | # to read multi-line JSON file and not bother with escaping
37+ run : | # to read multi-line JSON file and not bother with escaping
5338 if [ -f "${{ inputs.config_file }}" ]; then
5439 echo "config<<EOF" >> $GITHUB_OUTPUT
5540 cat ${{ inputs.config_file }} >> $GITHUB_OUTPUT
5843 echo "config={}" >> $GITHUB_OUTPUT
5944 fi
6045
46+ - name : Find all XML-files in this repository
47+ id : find-xml
48+ run : |
49+ FILES=`find . -type f -iname "*.xml"`
50+ #if [[ "${FILES}" != "" ]]; then
51+ # JSON=`printf '%s\n' "${FILES[@]}" | jq -R . | jq -s .`
52+ # echo "files=${JSON}" >> $GITHUB_OUTPUT
53+ #else
54+ # echo "files={}" >> $GITHUB_OUTPUT
55+ #fi
56+ echo "files=${FILES}" >> $GITHUB_OUTPUT
57+
6158 - name : Lint XML
6259 run : |
63- echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }}
64- echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }}
65- echo ${{ steps.read-json.outputs.config }}
60+ #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, 'bullshit') }}
61+ #echo ${{ contains(fromJSON(steps.read-json.outputs.config).ignore, '/path/to/file') }}
62+ for fn in ${{ steps.find-xml.outputs.files }}; do
63+ echo "the next file is $fn"
64+ cat $fn
65+ done
0 commit comments