Skip to content

Gated Auto-Merger

Gated Auto-Merger #7

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