-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
129 lines (113 loc) · 4.18 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: 'ScanMsg'
description: 'Fallout .msg files scanner'
author: 'Rotators'
branding:
icon: 'eye'
color: 'green'
# Same as running: ScanMsg.exe path/to/text/
#
# uses: wipe2238/ScanMsg@master
# with:
# path: 'path/to/text/'
# Same as running ScanMsg.exe path/to/text/ --relaxed
#
# uses: wipe2238/ScanMsg@master
# with:
# path: 'path/to/text/'
# relaxed: 'true'
# Same as running: cd path/to/text/ && ScanMsg.exe
#
# uses: wipe2238/ScanMsg@master
# with:
# workdir: 'path/to/text/'
# Same as running: cd data && ScanMsg.exe text/english/
#
# uses: wipe2238/ScanMsg@master
# with:
# path: text/english/
# workdir: data
inputs:
path:
description: >
Path to directories/files which should be scanned. If not set, current working directory is used.
required: false
no-exitcode:
description: >
If enabled, action will never fail build, even if errors in .msg files are found.
Otherwise, action's exitcode equals number of errors.
required: false
default: 'false'
relaxed:
description: >
If enabled, some of minor checks will be disabled, allowing to pass mods based on Fallout2 scripts sources.
By default
required: false
default: 'false'
translations:
description: >
Path to one or more directories containing translations.
If set, 'path' must point to base language (most likely text/english/), which will be used
Some inputs are ignored in translations scanning mode ('no-exitcode', 'relaxed').
required: false
default: ''
workdir:
description: >
Working directory.
required: false
default: ${{ github.workspace }}
executable:
description: ''
required: false
default: 'upstream'
deprecationMessage: 'will be removed in v0.7'
runs:
using: 'composite'
steps:
- name: Validate options
id: options
run: |
if [[ "${{ inputs.no-exitcode }}" != "true" ]] && [[ "${{ inputs.no-exitcode }}" != "false" ]]; then
echo "[ERROR] invalid input 'no-exitcode' : '${{ inputs.no-exitcode }}'"
echo "[ERROR] available values: 'true', 'false'"
exit 1
elif [[ "${{ inputs.no-exitcode }}" == "true" ]]; then
if [[ "${{ inputs.translations }}" != "" ]]; then
echo "[WARNING] Input ignored : 'no-exitcode'"
fi
echo "no-exitcode=--no-exitcode" >> $GITHUB_OUTPUT
fi
if [[ "${{ inputs.relaxed }}" != "true" ]] && [[ "${{ inputs.relaxed }}" != "false" ]]; then
echo "[ERROR] invalid input 'relaxed' : '${{ inputs.relaxed }}'"
echo "[ERROR] available values: 'true', 'false'"
exit 1
elif [[ "${{ inputs.relaxed }}" == "true" ]]; then
if [[ "${{ inputs.translations }}" != "" ]]; then
echo "[WARNING] Input ignored : 'relaxed'"
fi
echo "relaxed=--relaxed" >> $GITHUB_OUTPUT
fi
if [[ ! -f "${{ inputs.executable }}" ]]; then
if [[ "${{ inputs.executable }}" == "upstream" ]]; then
echo "executable=dotnet run --project ${GITHUB_ACTION_PATH//\\//}/ScanMsg/ScanMsg.NET5.csproj --" >> $GITHUB_OUTPUT
else
echo "[ERROR] invalid input 'executable' : '${{ inputs.executable }}'"
echo "[ERROR] file does not exists"
exit 1
fi
else
echo "executable=${GITHUB_WORKSPACE//\\//}/${{ inputs.executable }}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Run validation
run: |
if [[ "${{ inputs.translations }}" != "" ]]; then
${{ steps.options.outputs.executable }} --language-base ${{ inputs.path }} --translations ${{ inputs.translations }}
else
${{ steps.options.outputs.executable }} ${{ inputs.path }} ${{ steps.options.outputs.relaxed }} ${{ steps.options.outputs.no-exitcode }}
fi
rm -f ScanMsg.log
shell: bash
working-directory: ${{ inputs.workdir }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
DOTNET_NOLOGO: 'true'