forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Invoke webhook on PR merge (deephaven#6613)
- This gives us flexibility to create a docs issue from Jira or react differently depending on the PR merge data - Creating issues in the docs repo is deprecated - Tested webhook with data in a test repo to ensure PR data could be used correctly - Fixes DOC-249
- Loading branch information
Showing
2 changed files
with
10 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Create documentation ticket | ||
name: PR Merge Webhook | ||
|
||
on: | ||
pull_request_target: | ||
|
@@ -9,21 +9,19 @@ on: | |
- closed | ||
|
||
jobs: | ||
create-docs-ticket: | ||
# Only on merged PRs that contain the DocumentationNeeded flag | ||
if: github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'DocumentationNeeded') | ||
jira-webhook-pr-merge: | ||
# Only on merged PRs | ||
if: github.event.pull_request.merged | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create Issues | ||
id: create-issues | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.DOCS_ISSUES_PAT }} | ||
script: | | ||
const script = require('.github/workflows/create-docs-issues.js'); | ||
await script({github, context}); | ||
- name: Trigger PR Merge Webhook | ||
env: | ||
# Push the PR details in the webhook data. | ||
WEBHOOK_DATA: ${{ toJSON(github.event.pull_request) }} | ||
run: | | ||
curl -X POST -H 'X-Automation-Webhook-Token: ${{ secrets.JIRA_WEBHOOK_SECRET_PR_MERGE }}' -H "Content-Type: application/json" --data "$WEBHOOK_DATA" ${{ secrets.JIRA_WEBHOOK_URL_PR_MERGE }} | ||
- name: Slack Failure Message | ||
uses: slackapi/[email protected] | ||
|