I want to use CIRCLE_COMPARE_URL to analyze the commits for my build, but it seems to be empty when running workflow jobs. It does seem defined for single (non-workflow) jobs.
Is this a not-yet-supported feature? Is there a time table for getting it available in workflow jobs?
3 Likes
I would love to use the tip suggested here: Get list of commits in build
Any update on the status of this?
kibs
November 2, 2018, 9:36pm
4
I sm having the same problem, CIRCLE_COMPARE_URL is empty for all builds
I have the same problem here https://github.com/entria/entria-fullstack
is there any workaround?
mfittko
November 12, 2018, 10:11am
6
Hey, just successfully implemented a workaround which makes use of the API:
LAST_SUCCESSFUL_BUILD_URL="https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/tree/$CIRCLE_BRANCH?filter=completed&limit=1"
LAST_SUCCESSFUL_COMMIT=`curl -Ss -u "$API_KEY:" $LAST_SUCCESSFUL_BUILD_URL | jq -r '.[0]["vcs_revision"]'`
CHANGES_SINCE_LAST_COMMIT=`git diff --name-only $CIRCLE_SHA1..$LAST_SUCCESSFUL_COMMIT`
changesArray=( $CHANGES_SINCE_LAST_COMMIT )
You need to generate an API key which could be defined via environment variables.
Downside is that the algorithm only works for the latest build. In case you restart an older one, the change set will be empty.
@mfittko I’ve created this https://github.com/entria/entria-deploy to help manage which packages/modules to deploy on circleci
system
Closed
May 2, 2019, 10:53pm
9
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.