Skip to content

Commit

Permalink
ci: Invoke webhook on PR merge (deephaven#6613)
Browse files Browse the repository at this point in the history
- 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
mofojed authored Feb 4, 2025
1 parent 01da8df commit a96e342
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 53 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/create-docs-issues.js

This file was deleted.

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:
Expand All @@ -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]
Expand Down

0 comments on commit a96e342

Please sign in to comment.