Skip to content

Instantly share code, notes, and snippets.

@ravgeetdhillon
Created January 24, 2021 09:41
Show Gist options
  • Save ravgeetdhillon/7e0a908990746730e95f399cca5155fd to your computer and use it in GitHub Desktop.
Save ravgeetdhillon/7e0a908990746730e95f399cca5155fd to your computer and use it in GitHub Desktop.
Use repository_dispatch event to have control on when to generate a release by making an HTTP request

Use repository_dispatch event to have control on when to generate a release by making an HTTP request, e.g.:

Github Workflow:

name: Release
on:
  repository_dispatch:
    types: [semantic-release]
jobs:
# ...

To trigger a release, call (with a Personal Access Tokens stored in GITHUB_TOKEN environment variable):

$ curl -v -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/[org-name-or-username]/[repository]/dispatches -d '{ "event_type": "semantic-release" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment