-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.56 KB
/
Gated-Auto-Merger.yaml
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: Gated Auto-Merger
on:
workflow_dispatch:
inputs:
component:
type: choice
description: select component
options:
- Dashboard
env:
METADATA: "data/metadata.yaml"
jobs:
gated-auto-merger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Trigger GAM
env:
HYDRA_TOKEN: ${{ secrets.HYDRA_TOKEN }}
shell: bash
id: trigger_gam
run: |
python src/main.py --component ${{ github.event.inputs.component }}
echo "inside main"
pwd
ls
ls /tmp
- uses: actions/checkout@v3
with:
ref: metadata
path: metadata
- name: Copy metadata Json
id: copy_meta
run: |
meta=$(yq -o json $METADATA)
execution_id=$(echo $meta | jq -r '.metadata.execution_id')
echo "execution_id=$execution_id"
mkdir metadata/${execution_id}
cp data/metadata.yaml metadata/${execution_id}/metadata.yaml
echo "inside metadata"
cd metadata/${execution_id}/
pwd
ls
cat metadata.yaml
echo "EXECUTION_ID=${EXECUTION_ID}" >> $GITHUB_OUTPUT
- name: Commit and push changes to main branch
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: metadata
message: "Adding metadata.yaml for execution-id ${{ steps.copy_meta.outputs.EXECUTION_ID }}"
repository: red-hat-data-services/Gated-Auto-Merger