Skip to content

Instantly share code, notes, and snippets.

@timheuer
Last active November 25, 2020 03:38
Show Gist options
  • Save timheuer/d1386a6c66d355724da53f0a5e58a748 to your computer and use it in GitHub Desktop.
Save timheuer/d1386a6c66d355724da53f0a5e58a748 to your computer and use it in GitHub Desktop.
# set an env var with the date of the run
- name: Set date env
run: echo "CURRENT_DATE=$(Get-Date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
# use the env var at GitHub run ID as the BuildNumber (not sequential)
- name: Build
run: dotnet build --configuration Release /p:BuildNumber=${{ env.CURRENT_DATE }}.${{github.run_number}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment