Skip to content

Webhook payload. Is accessible for scripts? #2681

Closed Answered by dtrdic
bahag-chandrana asked this question in Q&A
Discussion options

You must be logged in to vote

hey @bahag-chandrana in Codemagic, accessing the event payload directly within scripts isn't straightforward because the event object isn't available for direct execution. The when condition can evaluate event payloads because it’s processed in a different phase of the workflow execution. However, you can achieve something similar by creating a script that generates release notes for a pull request (PR) using the GitHub CLI (gh) to fetch the PR title.

  1. First you need to create a personal access token as described in the GitHub documentation.

  2. Next, add this token as an environment variable in Codemagic and reference it in your workflow.

  1. Then add this script to your build
scripts: …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dtrdic
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants