Skip to content

Commit

Permalink
ci: get run_id from steps
Browse files Browse the repository at this point in the history
  • Loading branch information
levisingularity committed Jul 19, 2024
1 parent 99ee98c commit bc79b12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/invoke-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
});
- name: Get workflow run_id
id: get-run-id
uses: actions/github-script@v6
with:
script: |-
Expand All @@ -56,6 +57,7 @@ jobs:
const run_id = runs.data.workflow_runs[0].id;
console.log(run_id)
core.setOutput('run-id', run_id);
- name: Wait for workflow to complete
Expand All @@ -64,11 +66,13 @@ jobs:
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |-
const run_id = '${{ needs.invoke.outputs.run-id }}';
const run_id = '${{ steps.get-run-id.outputs.run-id }}';
const owner = context.repo.owner;
const repo = '${{ inputs.repo }}';
let conclusion = null;
console.log("run_id", run_id)
while (!conclusion) {
await new Promise(resolve => setTimeout(resolve, 30000));
const run = await github.rest.actions.getWorkflowRun({
Expand All @@ -80,6 +84,10 @@ jobs:
if (run.data.status === 'completed') {
conclusion = run.data.conclusion;
}
console.log("status", run.data.status)
console.log("conclusion", conclusion)
}
core.setOutput('conclusion', conclusion);
Expand Down

0 comments on commit bc79b12

Please sign in to comment.