Skip to content

Commit

Permalink
refactor: Utilize scripting options of git name-rev to simplify com…
Browse files Browse the repository at this point in the history
…mand.
  • Loading branch information
janpapenbrock committed Jan 3, 2025
1 parent 7452015 commit 222c1ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion basic/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ phases:
commands:
# Set COMMIT_INFO variables to send Git specifics to Cypress Cloud when recording
# https://docs.cypress.io/guides/continuous-integration/introduction#Git-information
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g') | sed 's/~.\+$//g'"
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | git name-rev --stdin --name-only | sed 's/remotes\/origin\///g') | sed 's/~.\+$//g'"
- export COMMIT_INFO_MESSAGE="$(git log -1 --pretty=%B)"
- export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)"
- export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"
Expand Down
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ phases:
commands:
# Set COMMIT_INFO variables to send Git specifics to Cypress Cloud when recording
# https://docs.cypress.io/guides/continuous-integration/introduction#Git-information
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g') | sed 's/~.\+$//g'"
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | git name-rev --stdin --name-only | sed 's/remotes\/origin\///g') | sed 's/~.\+$//g'"
- export COMMIT_INFO_MESSAGE="$(git log -1 --pretty=%B)"
- export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)"
- export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"
Expand Down

0 comments on commit 222c1ce

Please sign in to comment.