Appcenter: Allow to skip build by adding [skip ci] to the commit message

Created on 12 Feb 2019  路  16Comments  路  Source: microsoft/appcenter

Describe the solution you'd like
It would be good to have out of the box a feature that allows you to prevent certain commits from triggering a new build. This is extremely useful when committing eg. a version bump to the project. The tags could be eg.:

  • [skip ci]
  • [ci skip]

Describe alternatives you've considered
Create a script that could check the current commit message and try to match the skip-ci tags. Still this script would need to be added to each project separately, what is not convenient.

Additional context
n/a

Stale build feature request reviewed-DRI

Most helpful comment

@nrajpurkar right now we're able to wkorkaround this using following shell script:

if [[ $commit == *"[SKIP CI]"* ]]; then
    curl -i -X PATCH -H "X-API-Token:$APPCENTER_API_TOKEN" -H "Content-Type: application/json" -d "{\"status\":\"cancelling\"}" https://appcenter.ms/api/v0.1/apps/xxx/yyy/builds/$APPCENTER_BUILD_ID
else
    echo "Continue building"
fi

The important part is to allow cancelling the builds, so in the end we won't end up with all builds being red in the end 馃槈

All 16 comments

@hkosacki thanks for this feature request! I can understand how the build script workaround is tedious when working with several projects. I'll keep this feature request open to track total interest.

@nrajpurkar right now we're able to wkorkaround this using following shell script:

if [[ $commit == *"[SKIP CI]"* ]]; then
    curl -i -X PATCH -H "X-API-Token:$APPCENTER_API_TOKEN" -H "Content-Type: application/json" -d "{\"status\":\"cancelling\"}" https://appcenter.ms/api/v0.1/apps/xxx/yyy/builds/$APPCENTER_BUILD_ID
else
    echo "Continue building"
fi

The important part is to allow cancelling the builds, so in the end we won't end up with all builds being red in the end 馃槈

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further requests are made to keep it open.

Hey @nrajpurkar, are there any chances to see this feature live? 馃槈

Hey @hkosacki, this is not currently in our plans for May, but we'll continue to discuss this item as we prioritize work in the future.

I think between this and #26 there is potential for some more flexible build configuration which would reduce noise, reduce cost/consumption of build time and follow CI practices that are familiar in other platforms.

I am missing this feature. Canceling builds manually is quite tedious.

This is a really important feature. It's limiting the use of App Center for us. Also this is currently available in Azure Pipelines and we use it extensively in our web projects to commit build numbers back to our repo after build succeeds. we would have to fall back to Azure Pipelines in the meantime to build and deploy until this feature is released.

please implement this - such a waste of build time to trigger builds for silly things like updating the README file on github

@nilofer Any updates on this feature request?

@elamalani to provide an update.

MS announced that there will be no feature development on App Center until mid 2021. So hope you don't need it soon 馃槖

@nrajpurkar right now we're able to wkorkaround this using following shell script:

if [[ $commit == *"[SKIP CI]"* ]]; then
    curl -i -X PATCH -H "X-API-Token:$APPCENTER_API_TOKEN" -H "Content-Type: application/json" -d "{\"status\":\"cancelling\"}" https://appcenter.ms/api/v0.1/apps/xxx/yyy/builds/$APPCENTER_BUILD_ID
else
    echo "Continue building"
fi

The important part is to allow cancelling the builds, so in the end we won't end up with all builds being red in the end 馃槈

as much I would want this to work, $commit is empty on appcenter builds

I ended up with this script. Add it to appcenter-post-clone.sh, dont forget to go in and re-save the configuration on appcenter so the step gets picked up by appcenter.

#!/usr/bin/env bash
COMMIT=$(git show --pretty=format:%s -s HEAD)

# if iOS is empty we asume its Android
if [[ $COMMIT == *"[skip ci]"* ]] && [ -z "$APPCENTER_XCODE_PROJECT" ]; then
    echo "Cancelling android"
    curl -i -X PATCH -H "X-API-Token:$APPCENTER_TOKEN" -H "Content-Type: application/json" -d "{\"status\":\"cancelling\"}" https://appcenter.ms/api/v0.1/apps/{owner}/{app}/builds/$BUILD_BUILDID
fi

# if Android is empty we asume its iOS
if [[ $COMMIT == *"[skip ci]"* ]] && [ -z "$APPCENTER_ANDROID_VARIANT" ]; then
    echo "Cancelling iOS"
    curl -i -X PATCH -H "X-API-Token:$APPCENTER_TOKEN" -H "Content-Type: application/json" -d "{\"status\":\"cancelling\"}" https://appcenter.ms/api/v0.1/apps/{owner}/{app}/builds/$BUILD_BUILDID
fi

I am using BUILD_BUILDID as it always returns the build_id as oposed to $APPCENTER_BUILD_ID which can return timestamp if set so in the configuration, and that does not work with the api.

I made the skip ci lowercase to match what bitrise uses.

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

Was this page helpful?
0 / 5 - 0 ratings