-
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
- Loading branch information
1 parent
6add3d2
commit 27bc9b1
Showing
2 changed files
with
57 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, timestamp, and build id | ||
value: | ||
${{ format('{0}-{1}-{2}', steps.tags.outputs.relevant-sha, steps.tags.outputs.timestamp, github.run_id) }} | ||
|
||
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