Trigger CircleCI workflow on GitHub branch delete

Is there a way to trigger a circle ci workflow if a branch was manually deleted from github?

Hi @cobrix,

CircleCI does not trigger builds when a branch delete event is created, but you could use Github Actions
to trigger a build via our API. We have public documentation available here:

A sample actions workflow would look like this:

on:
  delete
jobs:
  trigger-circleci:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger CircleCI Build
        id: "deletebranch"
        uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.3
        env:
          CCI_TOKEN: ${{ secrets.CCI_TOKEN }}

The above would trigger a pipeline on CircleCI when a branch or tag is deleted.

Best Regards

1 Like