From 8da1c0a9a54110ff027faf155883973b7017389e Mon Sep 17 00:00:00 2001 From: Jan Papenbrock Date: Fri, 3 Jan 2025 11:55:13 +0100 Subject: [PATCH 1/2] 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. --- 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)" From 1d807b5e182a8091fd4ee9fe567157739b1a1a64 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 6 Jan 2025 10:28:52 -0500 Subject: [PATCH 2/2] empty commit