-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 1.09 KB
/
inspector_input.yml
File metadata and controls
36 lines (32 loc) · 1.09 KB
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
name: Send config to inspector
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read JSON
id: read_config
run: |
json=$(jq -c . < config/inspector.json)
echo "::set-output name=config::$json"
shell: bash
- name: Validate JSON
run: |
owner=${{ fromJSON(steps.read_config.outputs.config).owner }}
repo=${{ fromJSON(steps.read_config.outputs.config).repo }}
useSimpleSummary=${{ fromJSON(steps.read_config.outputs.config).useSimpleSummary }}
if [[ ! "$owner" =~ ^[a-zA-Z0-9]+$ ]]; then
echo "owner must be alphanumeric and at least 1 character long"
exit 1
fi
if [[ ! "$repo" =~ ^[a-zA-Z0-9]+$ ]]; then
echo "repo must be alphanumeric and at least 1 character long"
exit 1
fi
if [[ ! "$useSimpleSummary" =~ ^(true|false)$ ]]; then
echo "useSimpleSummary must be a boolean"
exit 1
fi