Skip to content

Gated Auto-Merger

Gated Auto-Merger #6

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
# - name: Commit and push changes to main branch
# uses: actions-js/push@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: metadata
# message: "Adding ${{ steps.remove_release_from_config.outputs.RELEASE_TO_BE_SETUP }} to releases.yaml"
# repository: red-hat-data-services/rhods-devops-infra