-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
57 lines (52 loc) · 1.42 KB
/
action.yml
File metadata and controls
57 lines (52 loc) · 1.42 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
54
55
56
57
name: 'StackGuardian Template Sync'
description: 'A reusable action to sync templates in push or pull mode.'
author: 'StackGuardian'
inputs:
# required
SG_TOKEN:
description: 'StackGuardian Token'
required: true
SG_TEMPLATE:
description: 'StackGuardian Template'
required: true
SG_ORG:
description: 'StackGuardian Organization'
required: true
# optional
SG_BASE_URL:
description: 'StackGuardian API Endpoint'
required: false
default: "https://api.app.stackguardian.io"
SG_BASE_PATH:
description: 'StackGuardian Path'
required: false
default: '.sg'
mode:
description: 'Sync mode - either "push" or "pull"'
required: false
default: "push"
runs:
using: 'composite'
steps:
- name: Set script path based on mode
shell: bash
run: |
if [ "${{ inputs.mode }}" == "pull" ]; then
echo "SCRIPT_PATH=${{ github.action_path }}/pull.sh" >> $GITHUB_ENV
else
echo "SCRIPT_PATH=${{ github.action_path }}/push.sh" >> $GITHUB_ENV
fi
- name: Run sync script
shell: bash
run: |
chmod +x $SCRIPT_PATH
$SCRIPT_PATH
env:
SG_TOKEN: ${{ inputs.SG_TOKEN }}
SG_BASE_PATH: ${{ inputs.SG_BASE_PATH }}
SG_TEMPLATE: ${{ inputs.SG_TEMPLATE }}
SG_ORG: ${{ inputs.SG_ORG }}
SG_BASE_URL: ${{ inputs.SG_BASE_URL }}
branding:
icon: 'refresh-cw'
color: 'blue'