convictional / trigger-workflow-and-wait

Trigger a workflow in another (or same) repository and wait for the job to finish.
MIT License
311 stars 151 forks source link

Update entrypoint.sh #85

Open Enrico-Infrinity opened 1 year ago

Enrico-Infrinity commented 1 year ago

Deleted the line #196 ----> echo "conclusion=${conclusion}" >> $GITHUB_OUTPUT

Inserted new line #200 ----> echo "conclusion=${conclusion}" >> $GITHUB_OUTPUT

Inserted new line #204 ----> echo "conclusion=${conclusion}" >> $GITHUB_OUTPUT

With this simple update, the routine is able to write the $conclusion value on the $GITHUB_OUTPUT, and now is possible to setup the "propagate_failure: false", and look at the result of the remote workflow action. You can try the functionality with my version below :)

steps:
  - name: 'Run test'
     id: 'run-test'
     uses: Enrico-Infrinity/trigger-workflow-and-wait@v1.0
     with: owner: remoteOwner
     repo: remoteRepo
     github_token: ${{ secrets.CICD_REPO_TOKEN }}
     workflow_file_name: main.yml
     ref: main
     wait_interval: 10
     client_payload: '{}'
     propagate_failure: false
     trigger_workflow: true
     wait_workflow: true

  - name: 'Set result'
    run: |
      echo ${{ steps.run-test.outputs.conclusion }}

It's a simple workaround, but it's working well.

Enjoy!! :)