Skip to content

Instantly share code, notes, and snippets.

@tyom
Created December 23, 2021 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyom/2b0dee7552e83d94e07ca9d8a761a742 to your computer and use it in GitHub Desktop.
Save tyom/2b0dee7552e83d94e07ca9d8a761a742 to your computer and use it in GitHub Desktop.
GH workflows tricks
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