Skip to content

Commit

Permalink
PLAT-4232-mergetime
Browse files Browse the repository at this point in the history
  • Loading branch information
angold5 committed Apr 17, 2024
1 parent 1bf704c commit 7c4069e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ The action packages, signs the Lambda functions, and uploads the application to
It adds the following metadata to the S3 object:

- committag - The tag of the git commit (if present), this falls back to a shortened commit has.
- repository - The git repository where the file was loaded from
- repository - The git repository where the file was loaded from.
- commitmessage - The first 50 characters of the git commit message, trimmed to the following regex: `tr -dc '[:alnum:]- '`
- commitsha - The full git commitsha of the git commit.
- mergetime - Time in UTC when git merge happend.
- skipcanary - 0 or 1 for skipcanary.

## Action Inputs

Expand Down Expand Up @@ -70,4 +72,4 @@ e.g.
`git tag v3.1-beta`

You can then navigate to the release page, and create a pre-release to validate that the tag is working as expected.
After you've merged the PR, then apply the correct tag for your release.
After you've merged the PR, then apply the correct tag for your release.
4 changes: 2 additions & 2 deletions scripts/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ fi
GIT_TAG=$(git describe --tags --first-parent --always)
# Cleaning the commit message to remove special characters
COMMIT_MSG=$(echo $COMMIT_MESSAGE | tr '\n' ' ' | tr -dc '[:alnum:]- ' | cut -c1-50)
# Gets merge time to main
MERGE_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
# Gets merge time to main - displaying it in UTC timezone
MERGE_TIME=$(TZ=UTC0 git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')

# Sanitise commit message and search for canary deployment instructions
MSG=$(echo $COMMIT_MESSAGE | tr '\n' ' ' | tr '[:upper:]' '[:lower:]')
Expand Down

0 comments on commit 7c4069e

Please sign in to comment.