-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
53 lines (52 loc) · 1.65 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
name: 'openfn pull and commit'
description: 'Pulls a project spec and state from a Lightning instance; commits to a branch'
branding:
icon: 'download'
color: 'purple'
inputs:
secret_input:
description: "OpenFN API KEY"
required: true
config_path_input:
description: "OpenFN Path to Config"
required: true
project_id_input:
description: "OpenFN Project ID"
required: true
branch_input:
description: 'Branch to commit the project state and spec'
required: true
commit_message_input:
description: "Pull Commit Message"
required: true
snapshots_input:
description: 'IDs of snapshots separated by spaces'
required: false
runs:
using: "composite"
steps:
- name: Checkout Project export
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_input }}
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18.x
- run: |
npm install -g @openfn/cli
if [ -z "${{ inputs.snapshots_input }}" ]; then
openfn pull $OPENFN_PROJECT_ID --config-path $OPENFN_CONFIG_PATH --no-confirm
else
openfn pull $OPENFN_PROJECT_ID --config-path $OPENFN_CONFIG_PATH --snapshots ${{ inputs.snapshots_input }} --no-confirm
fi
shell: bash
env:
OPENFN_API_KEY: ${{ inputs.secret_input }}
OPENFN_PROJECT_ID: ${{ inputs.project_id_input }}
OPENFN_CONFIG_PATH: ${{ inputs.config_path_input }}
- name: Commit new state file
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: ${{ inputs.commit_message_input }}
branch: ${{ inputs.branch_input }}