Last active
January 6, 2023 19:08
-
-
Save suryastef/8776940b2f6f6890279c7fbd0bc255d5 to your computer and use it in GitHub Desktop.
Article Source Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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