Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing semaphore environmental variable #484

Open
ethn opened this issue Dec 17, 2021 · 1 comment
Open

missing semaphore environmental variable #484

ethn opened this issue Dec 17, 2021 · 1 comment
Assignees

Comments

@ethn
Copy link

ethn commented Dec 17, 2021

Sorry I'm too lazy to write a PR for this, but the following from env/git.go...

var gitBranchVars = []string{"GIT_BRANCH", "APPVEYOR_REPO_BRANCH", "BRANCH_NAME", "BUILDKITE_BRANCH", "CIRCLE_BRANCH", "CI_BRANCH", "CI_BUILD_REF_NAME", "DRONE_BRANCH", "HEROKU_TEST_RUN_BRANCH", "TRAVIS_PULL_REQUEST_BRANCH", "TRAVIS_BRANCH", "WERCKER_GIT_BRANCH", "CI_COMMIT_REF_NAME", "BITRISE_GIT_BRANCH", "SEMAPHORE_GIT_PR_BRANCH", "SEMAPHORE_GIT_BRANCH", "GITHUB_REF_NAME"}

...contains a nice pattern for semaphore by listing these two in order: "SEMAPHORE_GIT_PR_BRANCH", "SEMAPHORE_GIT_BRANCH".

However the same is not true for the commit shas:

var gitCommitShaVars = []string{"GIT_COMMIT_SHA", "APPVEYOR_REPO_COMMIT", "BUILDKITE_COMMIT", "CIRCLE_SHA1", "CI_BUILD_REF", "CI_BUILD_SHA", "CI_COMMIT", "CI_COMMIT_ID", "DRONE_COMMIT", "GIT_COMMIT", "HEROKU_TEST_RUN_COMMIT_VERSION", "WERCKER_GIT_COMMIT", "TRAVIS_PULL_REQUEST_SHA", "TRAVIS_COMMIT", "CI_COMMIT_SHA", "BITRISE_GIT_COMMIT", "SEMAPHORE_GIT_SHA", "GITHUB_SHA"}

This leads to problems with pull request status updates on code climate, because semaphore is using the merge sha rather than the pr's head sha. (see https://docs.semaphoreci.com/essentials/project-workflow-trigger-options/)

If you were to add "SEMAPHORE_GIT_PR_SHA" immediately before "SEMAPHORE_GIT_SHA", this would solve that problem (and better parallel the branch handling).

@ethn
Copy link
Author

ethn commented Dec 17, 2021

(Our status updates had been hanging for months. I identified this problem today and was able to implement a workaround in semaphore, but this should fix problems for anyone using this integration).

@f-moya f-moya assigned f-moya and unassigned filipesperandio Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants