githubgithub-actionsworkflow

Workflow is not shown so I cannot run it manually (Github Actions)


I created the workflow Test but there is no Run workflow button to run it manually.

enter image description here

This is my test.yml file. Is there anything missing?

name: Test

on:
  release:
    types: [created]
  
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Run a one-line script
        run: echo Hello, world!

Solution

  • You need to put workflow_dispatch: under on:.

    name: Test
    
    on:
      release:
        types: [created]
      workflow_dispatch: # Put here!!
      
    jobs:
      build:
        runs-on: ubuntu-latest
    
        steps:
          - uses: actions/checkout@v2
    
          - name: Run a one-line script
            run: echo Hello, world!
    

    Then, a Run workflow button is shown.

    enter image description here

    enter image description here

    It's ok to put workflow_dispatch: before release:. It works as well.

    name: Test
    
    on:
      workflow_dispatch: # Putting here is also fine!!
      release:
        types: [created]
      
    jobs:
      build:
        runs-on: ubuntu-latest
    
        steps:
          - uses: actions/checkout@v2
    
          - name: Run a one-line script
            run: echo Hello, world!