-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
54 lines (50 loc) · 1.73 KB
/
action.yml
File metadata and controls
54 lines (50 loc) · 1.73 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: metanorma-new
description: composite action which help to run metanorma site generate
inputs:
type:
description: Document type
required: true
doctype:
description: Metanorma doctype
required: true
output-path:
description: Directory to put generated document
default: '.'
overwrite:
description: Overwrite existing document
default: '' # false
no-progress:
description: Don't show progress for long running tasks (like download)
default: 'true'
template:
description: Git hosted remote or local FS template skeleton
default: '' # false
use-bundler:
description: 'Run in bundler'
default: '' # false
ensure-manifest:
description: 'Generate minimal metanorma.yml manifest if missing'
default: '' # false
runs:
using: "composite"
steps:
- shell: bash
run: |
${{ inputs.use-bundler && 'bundle exec' || '' }} \
metanorma new ${{ inputs.output-path }} \
-t ${{ inputs.type }} \
-d ${{ inputs.doctype }} \
${{ inputs.overwrite && '--' || '--no-' }}overwrite \
${{ inputs.no-progress == 'true' && '--no-' || '' }}progress \
${{ inputs.template && format('-l {0}', inputs.template) || '' }}
- shell: bash
run: |
if [ ! -f ${{ inputs.output-path }}/metanorma.yml -a "${{ inputs.output-path }}" = "true" ]; then
cat << 'EOF' > ${{ inputs.output-path }}/metanorma.yml
metanorma:
source:
files:
- document.adoc
EOF
echo "${{ inputs.output-path }}/metanorma.yml generated."
fi