Created
December 23, 2021 13:06
-
-
Save tyom/2b0dee7552e83d94e07ca9d8a761a742 to your computer and use it in GitHub Desktop.
GH workflows tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
# Add an optional dynamic string based on a PR number | |
SOME_ENV_VAR: static-string/${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || '' }} | |
jobs: | |
some-job: | |
steps: | |
# Conditionally name a step | |
- name: Step for ${{ github.event_name == 'pull_request' && '(PR)' || '(main)' }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment