Skip to content

Instantly share code, notes, and snippets.

@suryastef
Last active January 6, 2023 19:08
Show Gist options
  • Select an option

  • Save suryastef/8776940b2f6f6890279c7fbd0bc255d5 to your computer and use it in GitHub Desktop.

Select an option

Save suryastef/8776940b2f6f6890279c7fbd0bc255d5 to your computer and use it in GitHub Desktop.
Article Source Code
name: Trigger Workflow Example
on:
push:
branches: ["master"]
workflow_dispatch:
jobs:
trigger-website:
runs-on: ubuntu-latest
steps:
- name: Website
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_PAT }}
script: |
const result = await github.rest.actions.createWorkflowDispatch({
owner: 'username-or-oragnization',
repo: 'repo-name',
workflow_id: 'workflow.yaml',
ref: 'master'
})
console.log(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment