Trigger GAM with custom decider #5
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: Trigger GAM with custom decider | |
on: | |
# schedule: | |
# - cron: '0 12 * * 5' # Runs every Friday at 12:00 PM UTC | |
workflow_dispatch: {} | |
env: | |
COMPONENT: "Dashboard" | |
jobs: | |
run-decider: | |
runs-on: ubuntu-latest | |
outputs: | |
trigger_gam: ${{ steps.decider.outputs.trigger_gam }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run custom decider script | |
id: decider | |
run: | | |
cd ./.github/scripts/ | |
chmod +x custom_decider.sh | |
decision=$(./custom_decider.sh) | |
echo "trigger_gam=${decision}" | tee -a $GITHUB_OUTPUT | |
trigger-gam: | |
needs: run-decider | |
if: needs.run-decider.outputs.trigger_gam == 'true' | |
uses: red-hat-data-services/Gated-Auto-Merger/.github/workflows/Gated-Auto-Merger.yaml@main | |
secrets: inherit | |
with: | |
component: "Dashboard" # only acceps inputs from the github context and the “needs” object | |
print-gam-execution-metadata: | |
needs: trigger-gam | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: metadata_file | |
- name: Print GAM Execution Metadata | |
run: cat metadata.yaml |