Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
fix: use typescript to support other type of datastructures (#2616)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jun 3, 2024
1 parent 0e1a12b commit 2e90c86
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/actions/check-dependent-jobs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ inputs:
outputs:
isSuccess:
description: The evaluated result of all provided jobs in the needs context.
value: ${{ steps.test.outputs.isSuccess }}
value: ${{ steps.check.outputs.isSuccess }}
status:
description: One of success or failure.
value: ${{ steps.test.outputs.status }}
value: ${{ steps.check.outputs.status }}
runs:
using: composite
steps:
- id: test
run: |
RESULT=$(echo '${{ inputs.needs }}' | jq -s 'map(.[].result) | all(.=="success")')
echo "isSuccess=${RESULT}" >> $GITHUB_OUTPUT
if [[ $RESULT == true ]]; then
STATUS=success
else
STATUS=failure
fi
echo "status=${STATUS}" >> $GITHUB_OUTPUT
shell: bash
- id: check
uses: actions/github-script@v7
env:
NEEDS: ${{ inputs.needs }}
with:
script: |
const needs = JSON.parse(process.env.NEEDS)
const allSuccess = Object.values(needs).every(job => job.result === 'success')
console.log(allSuccess)
core.setOutput('isSuccess', allSuccess)
core.setOutput('status', allSuccess ? 'success' : 'failure')

0 comments on commit 2e90c86

Please sign in to comment.