Skip to content

Commit

Permalink
Separate env variables in "transport" GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Nov 22, 2024
1 parent 77a5aa7 commit a7d9091
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/transport.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: MESSAGEix-Transport

env:
target: transport.yaml --repo=iiasa/message_data
# The repository, branch, and workflow file name to dispatch
target-repo: iiasa/message_data
target-branch: dev
target-workflow: transport

# Starting point of the workflow.
# Use this value to build from a certain scenario:
Expand Down Expand Up @@ -33,12 +36,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Invoke "transport.yaml" workflow in message_data
- name: Invoke "${{ env.target-workflow }}" workflow in ${{ env.target-repo }}
env:
GH_TOKEN: ${{ secrets.MESSAGE_DATA_DISPATCH_TOKEN }}
run: |
gh workflow run \
${{ env.target }} --ref=dev \
${{ env.target-workflow }}.yaml \
--repo=${{ env.target-repo }} \
--ref=${{ env.target-ref }} \
--field ref=${{ github.ref }} \
--field sha=${{ github.sha }} \
--field base=${{ env.base }} \
Expand All @@ -47,6 +52,6 @@ jobs:
sleep 5
gh run list \
--workflow=${{ env.target }} \
--workflow=${{ env.target-workflow.yaml }} --repo=${{ env.target-repo }} \
--json url,status \
--jq 'map(select(.status != "completed"))[0].url' >> $GITHUB_STEP_SUMMARY

0 comments on commit a7d9091

Please sign in to comment.