add action to append date to artifact name during upload
This commit is contained in:
parent
be48eadbc6
commit
822e9e7753
2 changed files with 35 additions and 7 deletions
26
.github/actions/upload-dated-artifact/action.yaml
vendored
Normal file
26
.github/actions/upload-dated-artifact/action.yaml
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
name: Upload dated artifact
|
||||
description: Uploads an artifact with a datetime
|
||||
|
||||
inputs:
|
||||
name:
|
||||
description: The name of the artifact
|
||||
required: true
|
||||
path:
|
||||
description: The path to the file/folder to upload
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
# https://stackoverflow.com/questions/60942067/get-current-date-and-time-in-github-workflows
|
||||
- name: Get current datetime
|
||||
id: date
|
||||
shell: bash
|
||||
run: echo "::set-output name=date::$(date '+%Y-%m-%d_%H-%M-%S')"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.name }}_${{ steps.date.outputs.date }}
|
||||
path: ${{ inputs.path }}
|
||||
if-no-files-found: error
|
||||
Loading…
Add table
Add a link
Reference in a new issue