-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow use of consistent container tagging
Adds ability to generate consistent container tag across workflows.
- Loading branch information
1 parent
2877805
commit 3985c68
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Tagging | ||
description: Consistent and unique container tagging, suitable for immutable tagging | ||
outputs: | ||
relevant-sha: | ||
description: | | ||
Short commit sha based on last commit of pull request, or the last merge commit | ||
value: ${{ steps.tags.outputs.relevant-sha }} | ||
timestamp: | ||
description: | | ||
UTC time of when this action was run | ||
value: ${{ steps.tags.outputs.timestamp }} | ||
tag: | ||
description: | | ||
Recommended container tag, using commit sha and timestamp | ||
value: | ||
${{ format('{0}-git{1}', steps.tags.outputs.timestamp, steps.tags.outputs.relevant-sha) }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate tags | ||
id: tags | ||
env: | ||
RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
shell: bash | ||
run: | | ||
echo "relevant-sha=$(git rev-parse --short $RELEVANT_SHA)" >> $GITHUB_OUTPUT | ||
echo "timestamp=$(date -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT |
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