-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
36 lines (36 loc) · 941 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# action.yml
name: 'GoTest JSON to JUnit XML'
description: 'Convert GoTest JSON to JUnit XML'
branding:
icon: 'award'
color: 'green'
inputs:
input:
description: 'Input JSON file(s)'
required: true
output:
description: 'Output XML file'
required: true
runs:
using: 'composite'
steps:
- id: json
env:
INPUT: ${{ inputs.input }}
run: |
json="tmp.$RANDOM.json"
jq -ns 'inputs' $(echo "$INPUT") > "$json"
echo "json=$json" >> $GITHUB_OUTPUT
shell: bash
- uses: pl-strflt/saxon@v1
env:
JSON: ${{ steps.json.outputs.json }}
INPUT_INPUT: ${{ inputs.input }}
INPUT_OUTPUT: ${{ inputs.output }}
with:
args: -json:$JSON -xsl:/etc/gotest.xsl -o:$INPUT_OUTPUT
- if: (success() || failure()) && steps.json.outputs.json != ''
env:
JSON: ${{ steps.json.outputs.json }}
run: rm "$JSON"
shell: bash