Skip to content

Commit fdea6f1

Browse files
committed
docs: CodeBuild branch info: Cut off suffix like ~3 if remote branch has advanced compared to current commit. Fixes main~3 to become main instead.
1 parent 267e962 commit fdea6f1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

basic/buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ phases:
77
commands:
88
# Set COMMIT_INFO variables to send Git specifics to Cypress Cloud when recording
99
# https://docs.cypress.io/guides/continuous-integration/introduction#Git-information
10-
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')"
10+
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g') | sed 's/~.\+$//g'"
1111
- export COMMIT_INFO_MESSAGE="$(git log -1 --pretty=%B)"
1212
- export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)"
1313
- export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ phases:
2828
commands:
2929
# Set COMMIT_INFO variables to send Git specifics to Cypress Cloud when recording
3030
# https://docs.cypress.io/guides/continuous-integration/introduction#Git-information
31-
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')"
31+
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g') | sed 's/~.\+$//g'"
3232
- export COMMIT_INFO_MESSAGE="$(git log -1 --pretty=%B)"
3333
- export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)"
3434
- export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"

0 commit comments

Comments
 (0)