Gated Auto-Merger #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
with: | |
path: main | |
- name: Install dependencies | |
run: | | |
cd main | |
pip install -r requirements.txt | |
- name: Trigger GAM | |
env: | |
HYDRA_TOKEN: ${{ secrets.HYDRA_TOKEN }} | |
shell: bash | |
id: trigger_gam | |
run: | | |
cd main | |
python src/main.py --component ${{ github.event.inputs.component }} | |
echo "inside main" | |
pwd | |
ls | |
cd ../ | |
- uses: actions/checkout@v3 | |
with: | |
ref: metadata | |
path: metadata | |
- name: Copy metadata Json | |
id: copy_meta | |
run: | | |
meta=$(yq -o json main/$METADATA) | |
execution_id=$(echo $meta | jq -r '.metadata.execution_id') | |
echo "execution_id=$execution_id" | |
mkdir metadata/executions/${execution_id} | |
cp main/data/metadata.yaml metadata/executions/${execution_id} | |
echo "inside metadata" | |
cd metadata/executions/${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 }} | |
directory: metadata | |
branch: metadata | |
message: "Adding metadata.yaml for execution-id ${{ steps.copy_meta.outputs.EXECUTION_ID }}" | |
repository: red-hat-data-services/Gated-Auto-Merger |