Skip to content

feat: add script and workflow to trigger renovate via dashboard #38

feat: add script and workflow to trigger renovate via dashboard

feat: add script and workflow to trigger renovate via dashboard #38

Workflow file for this run

name: Trigger renovate
on:
pull_request: # test it when the files are changed
paths:
- trigger.ts
- .github/workflows/trigger.yml
schedule: # make sure renovate checks at least once an hour
# every hour at minute thirty https://crontab.guru/#30_%2A_%2A_%2A_%2A
- cron: "30 * * * *"
workflow_dispatch: # trigger it for other repos from the browser
inputs:
repo:
description: "name of repository (without bettermarks/)"
type: string
required: true
dashboardIssue:
description: "Optional: the number of the dependency dashboard issue"
default: 0
type: number
ref:
description: "Optional: branch/ref to use from renovate-config"
default: main
type: string
workflow_call: # use it in other workflows with repo specific triggers/schedule
inputs:
repo:
description: "name of repository to trigger (without bettermarks/)"
type: string
required: true
dashboardIssue:
description: "Optional: the number of the dependency dashboard issue"
default: 0
type: number
ref:
description: "Optional: branch/ref to use from renovate-config"
default: main
type: string
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
repository: "bettermarks/renovate-config"
ref: ${{ inputs.ref }}
path: ${{ github.workspace }}/renovate-config
- uses: actions/github-script@v8
env:
OWNER_REPO: bettermarks/${{ inputs.repo || 'renovate-config' }}
DASHBOARD_ISSUE: ${{ inputs.dashboardIssue }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const {trigger} = await import('${{ github.workspace }}/renovate-config/trigger.ts');
console.log(await trigger({github, context, core, exec}));