From 24af18c3ab235674ebddb4cb7cc633bce107b192 Mon Sep 17 00:00:00 2001 From: Jan Papenbrock Date: Mon, 6 Jan 2025 19:47:22 +0100 Subject: [PATCH] docs: AWS codebuild: Avoid branch names like `main~3`. (#919) * 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. * empty commit --------- Co-authored-by: Jennifer Shehane --- basic/buildspec.yml | 2 +- buildspec.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/buildspec.yml b/basic/buildspec.yml index 8d45776d2..b87a73213 100644 --- a/basic/buildspec.yml +++ b/basic/buildspec.yml @@ -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')" + - 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_MESSAGE="$(git log -1 --pretty=%B)" - export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)" - export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)" diff --git a/buildspec.yml b/buildspec.yml index 3684a8d6f..e4d10af71 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -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')" + - 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_MESSAGE="$(git log -1 --pretty=%B)" - export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)" - export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"