-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4973be
commit 55e2409
Showing
4 changed files
with
23 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
This action exposes git commit data. | ||
|
||
- **GIT_COMMIT_SHA** expose `commit hash` | ||
- **GIT_COMMIT_SHORT_SHA** expose `abbreviated commit hash` | ||
- **GIT_COMMIT_AUTHOR** expose `Author name <[email protected]>` | ||
- **GIT_COMMIT_AUTHOR_NAME** expose `Author name` | ||
- **GIT_COMMIT_AUTHOR_EMAIL** expose `[email protected]` | ||
|
@@ -20,6 +22,9 @@ This action exposes git commit data. | |
|
||
- name: Print git commit data | ||
run: | | ||
echo "Get commit info" | ||
echo " - ${{ env.GIT_COMMIT_SHA }}" | ||
echo " - ${{ env.GIT_COMMIT_SHORT_SHA }}" | ||
echo "Get author info" | ||
echo " - ${{ env.GIT_COMMIT_AUTHOR }}" | ||
echo " - ${{ env.GIT_COMMIT_AUTHOR_NAME }}" | ||
|
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
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 |
---|---|---|
|
@@ -2,11 +2,19 @@ | |
|
||
apk add --no-cache git > /dev/null | ||
|
||
TEST_COMMIT_SHA=f554bec | ||
TEST_COMMIT_SHA=f554bec660038601b8882c1e0cc5d0d8fcebf221 | ||
|
||
# Load git_log_format function | ||
source git-commit-data.sh > /dev/null 2>&1 | ||
|
||
@test "git_log_format: sha" { | ||
test_git_log_format "$TEMPLATE_SHA_FORMAT" "f554bec660038601b8882c1e0cc5d0d8fcebf221" | ||
} | ||
|
||
@test "git_log_format: short sha" { | ||
test_git_log_format "$TEMPLATE_SHORT_SHA_FORMAT" "f554bec" | ||
} | ||
|
||
@test "git_log_format: author" { | ||
test_git_log_format "$TEMPLATE_AUTHOR_FORMAT" "rlespinasse <[email protected]>" | ||
} | ||
|