Notify ntfy with workflow facts and test dispatch

This commit is contained in:
2026-09-21 12:14:37 -07:00
parent 4fcbd2d2d2
commit 2d56fb7f29
5 changed files with 123 additions and 8 deletions
+17
View File
@@ -2,6 +2,11 @@ name: Mirror to Gitea
on:
workflow_dispatch:
inputs:
notification_test:
description: Send a test notification without running the mirror
type: boolean
default: false
schedule:
- cron: '0 */4 * * *' # Run every 4 hours
@@ -18,8 +23,20 @@ jobs:
node-version: 20
- name: Run Mirror Script
id: sync
if: ${{ !inputs.notification_test }}
run: node mirror.js
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ secrets.GITEA_URL }}
- name: Notify via ntfy
if: ${{ always() }}
run: node notify.js
env:
NTFY_TOPIC_URL: ${{ secrets.NTFY_TOPIC_URL }}
WORKFLOW_KIND: mirror
STEP_OUTCOME: ${{ steps.sync.outcome }}
TEST_NOTIFICATION: ${{ inputs.notification_test }}
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
+10
View File
@@ -15,8 +15,18 @@ jobs:
with:
node-version: 20
- name: Rename mirrors missing on GitHub
id: sync
run: node rename-gone-mirrors.js
env:
GH_PAT: ${{ secrets.GH_PAT }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ secrets.GITEA_URL }}
- name: Notify via ntfy
if: ${{ always() }}
run: node notify.js
env:
NTFY_TOPIC_URL: ${{ secrets.NTFY_TOPIC_URL }}
WORKFLOW_KIND: rename
STEP_OUTCOME: ${{ steps.sync.outcome }}
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}