Skip to content

Commit

Permalink
fixup! Fallback on using job key
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Aug 16, 2024
1 parent 6d87b00 commit 6eb6129
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:
output: ${{ steps.job.outputs.name }}
expected: test-empty-name

test-numeric-name:
name: 1
test-null-name:
name: null
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -74,7 +74,7 @@ jobs:
run: '[[ "${output}" == "${expected}" ]] || exit 1'
env:
output: ${{ steps.job.outputs.name }}
expected: 1
expected: null

test-matrix:
name: Matrix
Expand Down
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
# e.g. octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch -> .github/workflows/my-workflow.yml
workflow_path="$(echo "${workflow_ref%@*}" | cut -d/ -f3-)"
job_name_template="$(job_key="${job_key}" yq '.jobs[env(job_key)].name // empty' "${repo_path}/${workflow_path:?}")"
job_name_template="$(job_key="${job_key}" yq '.jobs[env(job_key)] | select(has("name")).name' "${repo_path}/${workflow_path:?}")"
echo "name-template=${job_name_template}" | tee -a "$GITHUB_OUTPUT"
env:
repo_path: ${{ inputs.path || format('{0}/repo', github.action_path) }}
Expand Down

0 comments on commit 6eb6129

Please sign in to comment.