-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
93 lines (92 loc) · 4.02 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# action.yaml
name: "Grai Server Action"
description: "Determines the impact of changing data on downstream users"
inputs:
client-host:
description: "The host for the Grai server"
required: false
default: "https://api.grai.io"
client-port:
description: "The port for the Grai server"
required: false
default: "443"
api-key:
description: "The api key for the Grai server"
required: true
action:
description: "update or tests"
required: false
default: "update"
connection_id:
description: "UUID for an existing connection"
required: false
connector_name:
required: false
connector_namespace:
required: false
connector_metadata:
required: false
connector_secrets:
required: false
file_path:
required: false
description: "Path to the file to be uploaded"
source_name:
required: false
description: "Name of the source"
runs:
using: "composite"
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Dependencies
run: pip install -r ${GITHUB_ACTION_PATH}/requirements.txt
shell: bash
- name: Pass Inputs to Shell
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
echo "GRAI_CLIENT_HOST=${{ inputs.client-host }}" >> $GITHUB_ENV
echo "GRAI_CLIENT_PORT=${{ inputs.client-port }}" >> $GITHUB_ENV
echo "GRAI_API_KEY=${{ inputs.api-key }}" >> $GITHUB_ENV
echo "GRAI_ACTION=${{ inputs.action }}" >> $GITHUB_ENV
echo "GRAI_CONNECTION_ID=${{ inputs.connection_id }}" >> $GITHUB_ENV
echo "GRAI_CONNECTOR_NAME=${{ inputs.connector_name }}" >> $GITHUB_ENV
echo "GRAI_CONNECTOR_NAMESPACE=${{ inputs.connector_namespace }}" >> $GITHUB_ENV
echo 'GRAI_CONNECTOR_METADATA=${{ inputs.connector_metadata }}' >> $GITHUB_ENV
echo 'GRAI_CONNECTOR_SECRETS=${{ inputs.connector_secrets }}' >> $GITHUB_ENV
echo 'GRAI_SOURCE_NAME=${{ inputs.source_name }}' >> $GITHUB_ENV
echo 'GRAI_FILE_PATH=${{ inputs.file_path }}' >> $GITHUB_ENV
echo "GITHUB_OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "GITHUB_REPO=${{ github.event.repository.name }}" >> $GITHUB_ENV
echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "GIT_HEAD_SHA=${{ github.event.after }}" >> $GITHUB_ENV
echo "GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
- name: Pass Inputs to Shell
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo "GRAI_CLIENT_HOST=${{ inputs.client-host }}" >> $GITHUB_ENV
echo "GRAI_CLIENT_PORT=${{ inputs.client-port }}" >> $GITHUB_ENV
echo "GRAI_API_KEY=${{ inputs.api-key }}" >> $GITHUB_ENV
echo "GRAI_ACTION=${{ inputs.action }}" >> $GITHUB_ENV
echo "GRAI_CONNECTION_ID=${{ inputs.connection_id }}" >> $GITHUB_ENV
echo "GRAI_CONNECTOR_NAME=${{ inputs.connector_name }}" >> $GITHUB_ENV
echo "GRAI_CONNECTOR_NAMESPACE=${{ inputs.connector_namespace }}" >> $GITHUB_ENV
echo 'GRAI_CONNECTOR_METADATA=${{ inputs.connector_metadata }}' >> $GITHUB_ENV
echo 'GRAI_CONNECTOR_SECRETS=${{ inputs.connector_secrets }}' >> $GITHUB_ENV
echo 'GRAI_SOURCE_NAME=${{ inputs.source_name }}' >> $GITHUB_ENV
echo 'GRAI_FILE_PATH=${{ inputs.file_path }}' >> $GITHUB_ENV
echo "GITHUB_OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "GITHUB_REPO=${{ github.event.repository.name }}" >> $GITHUB_ENV
echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "GIT_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
echo "GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}" >> $GITHUB_ENV
echo "GITHUB_PR_REFERENCE=${{ github.event.number }}" >> $GITHUB_ENV
echo "GITHUB_PR_TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
- name: Create Run
id: create-run
run: python ${GITHUB_ACTION_PATH}/src/create_run.py
shell: bash