Skip to content

Run sungSongsMonitor #514

Run sungSongsMonitor

Run sungSongsMonitor #514

name: Run sungSongsMonitor
on:
schedule:
- cron: '0,30 * * * *'
workflow_dispatch:
jobs:
run_script:
runs-on: ubuntu-latest
env:
VITE_APP_POSTHOG_KEY: ${{ secrets.POSTHOG_PAT_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Run script
run: node scripts/monitorPosthogEvents.mjs
- name: "Decrease attempts count"
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_PAT_REPOS_WORKFLOW }}
script: |
github.rest.actions.updateRepoVariable({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'MONITORING_ATTEMPTS',
value: '' + (${{ vars.MONITORING_ATTEMPTS }} - 1) + ''
});
if (${{ vars.MONITORING_ATTEMPTS }} - 1 <= 0) {
github.rest.actions.disableWorkflow({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'monitor-posthog-events.yml',
});
}