Files
phishingclub/.github/workflows/notify.yml
T
RonniSkansing 13e29d16e5 singleton action
Signed-off-by: RonniSkansing <rskansing@gmail.com>
2026-09-17 00:30:02 +02:00

47 lines
1.2 KiB
YAML

name: notify
on:
watch:
types: [started]
issues:
types: [opened]
permissions:
actions: write
concurrency:
group: notify-${{ github.event_name }}
cancel-in-progress: true
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Star
if: github.event_name == 'watch'
env:
NOTIFY_URL: ${{ secrets.NOTIFY_URL }}
run: |
curl -s -H "Title: New star" -H "Tags: star" \
-d "new star" \
"$NOTIFY_URL"
- name: Issue
if: github.event_name == 'issues'
env:
NOTIFY_URL: ${{ secrets.NOTIFY_URL }}
run: |
curl -s -H "Title: New issue" -H "Tags: bug" \
-d "new issue created" \
"$NOTIFY_URL"
- name: Prune previous notify runs
if: always()
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
gh api "/repos/$REPO/actions/workflows/notify.yml/runs?status=completed&per_page=100" \
--jq '.workflow_runs[].id' \
| while read -r id; do
gh api --method DELETE "/repos/$REPO/actions/runs/$id" || true
done