Skip to content

Commit

Permalink
Add comment explaining ternary expression
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Jul 12, 2023
1 parent eca53f3 commit e38c9d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ jobs:
needs: ["test"]
env:
IMAGE_NAME: "nsidc/qgreenland"
# GitHub Actions expressions don't have great conditional support, so
# writing a ternary expression looks a lot like bash. In Python, this
# would read as:
# 'latest' if github.ref_type == 'branch' else github.ref_name
# https://docs.github.com/en/actions/learn-github-actions/expressions
IMAGE_TAG: "${{ github.ref_type == 'branch' && 'latest' || github.ref_name }}"
steps:
- name: "Check out repository"
Expand Down

0 comments on commit e38c9d8

Please sign in to comment.