We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65fd9a4 commit 9e9e875Copy full SHA for 9e9e875
2 files changed
action.yml
@@ -13,6 +13,8 @@ runs:
13
steps:
14
- run: ${{ github.action_path }}/validator.sh
15
shell: bash
16
+ env:
17
+ FILEPATH: ${{ inputs.filepath }}
18
branding:
19
icon: 'check-square'
20
color: 'gray-dark'
validator.sh
@@ -3,12 +3,16 @@
3
read_file()
4
{
5
invalid=()
6
- file=".env"
+ file="$FILEPATH"
7
+ if [ ! -f "$file" ]; then
8
+ echo "ERROR! $file file does not exist."
9
+ exit 1
10
+ fi
11
while IFS="=" read -r key value; do
12
[ -z "$value" ] && invalid+=("$key")
done < "$file"
if (( ${#invalid[@]} )); then
- echo "ERROR!! There are some invalid environment variables:"
+ echo "ERROR! There are some invalid environment variables:"
printf '%s\n' "${invalid[@]}"
exit 1
fi
0 commit comments