Skip to content

Commit

Permalink
Merge pull request #1 from PortSwigger/actions
Browse files Browse the repository at this point in the history
Add webhooks.
  • Loading branch information
ps-porpoise authored Nov 27, 2023
2 parents 334684d + 1a64792 commit 532d540
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/issue_webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Issues Webhook

on:
issues:
types: [opened, reopened]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Push to webhook
run: |
echo $AUTHOR $TITLE $LINK
curl "$WEBHOOK" -X POST -H "Authorization: $AUTH_TOKEN" -d "$AUTHOR"$'\n'"$TITLE"$'\n'"$LINK"
env:
AUTHOR: ${{ github.event.issue.user.login }}
TITLE: ${{ github.event.issue.title }}
LINK: ${{ github.event.issue.html_url }}
WEBHOOK: ${{ secrets.WEBHOOK_URL }}
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}

21 changes: 21 additions & 0 deletions .github/workflows/pr_webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pull Request Webhook

on:
pull_request_target:
types: [opened, reopened, edited, synchronize]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Push to webhook
run: |
echo $AUTHOR $TITLE $LINK
curl "$WEBHOOK" -X POST -H "Authorization: $AUTH_TOKEN" -d "$AUTHOR"$'\n'"$TITLE"$'\n'"$LINK"
env:
AUTHOR: ${{ github.event.pull_request.user.login }}
TITLE: ${{ github.event.pull_request.title }}
LINK: ${{ github.event.pull_request.html_url }}
WEBHOOK: ${{ secrets.WEBHOOK_URL }}
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}

0 comments on commit 532d540

Please sign in to comment.