Creating a workflow with GitHub Actions

You can use GitHub's visual editor or GitHub Marketplace to create your workflow and manage its actions, or you can manually create a workflow file using a text editor.

Note: GitHub Actions is currently in public beta and subject to change.

In this guide:

People with write or admin access can create, view, edit, and cancel workflows for a repository.

For more information about workflow files, see "About GitHub Actions".

For a complete list of configuration options, see "Workflow configuration options" in the GitHub Developer documentation.

Creating a workflow using the visual editor

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Actions.

    Actions tab in the main repository navigation

  3. Click Create a new workflow.

    Create a new workflow button

  4. In the lower-right corner of the new workflow, click Edit.

    Edit link on the new workflow

  5. On the right side of the screen, under "Configure workflow", type a name for your workflow.

    Field for workflow name

  6. Under "Run", use the drop-down menu, and click the event you'd like to trigger your workflow.

    Run drop-down menu with event options

  7. Click Done.

    Done button to finish configuring workflow

  8. To add an action to your workflow, click the blue dot on the bottom of your workflow and drag it straight down to connect with the box below.

    Visual editor option to add an action to the workflow

  9. Under "Choose action", type the name of an action, then under the name of the action you'd like to add, click Use.

    Choose action pane with list of actions

  10. Configure your action, then click Done. For a complete list of configuration options, see "Action blocks" in the GitHub Developer documentation.

    Options for configuring an action and Done button to finish configuring action

  11. Optionally, to add more actions to your workflow, repeat steps 9-11, connecting actions within the workflow as desired.

  12. When you've finished editing your workflow, in the upper-right corner, click Start commit.

    Start commit button

  13. Type your commit message, choose a commit email address, and choose a commit branch, then click Propose new file. Committing a workflow enables it for your branch.

    Commit pane and Propose new file button

  14. Type a name and description for your pull request, then click Create pull request.

    Fields and button for creating a pull request

  15. You can see your workflow run on the Checks tab of your pull request.

    Running workflow on the pull request's Checks tab

  16. To enable your workflow for the entire repository, merge your pull request.

To view your enabled workflow and its status, see "Viewing your repository's workflows."

Creating a workflow using the file editor

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Actions.

    Actions tab in the main repository navigation

  3. Click Create a new workflow.

    Create a new workflow button

  4. To open the file editor, click Edit new file.

    Edit new file tab

  5. Using the file editor, add at least one action to the main.workflow file. For a complete list of configuration options, see "Action blocks" in the GitHub Developer documentation.

    Editor with a new main.workflow file

  6. When you've finished editing your workflow, in the upper-right corner, click Start commit.

    Start commit button

  7. Type your commit message, choose a commit email address, and choose a commit branch, then click Propose new file. Committing a workflow enables it for your branch.

    Commit pane and Propose new file button

  8. Type a name and description for your pull request, then click Create pull request.

    Fields and button for creating a pull request

  9. You can see your workflow run on the Checks tab of your pull request.

    Running workflow on the pull request's Checks tab

  10. To enable your workflow for the entire repository, merge your pull request.

To view your enabled workflow and its status, see "Viewing your repository's workflows."

Adding an action to your workflow from GitHub Marketplace

  1. At the top of any page, click Marketplace.

    Marketplace link in the global navigation menu at the top of every page

  2. Browse to the action you'd like to install, then click on the action's name.

  3. Optionally, to use a previous version of the action, use the drop-down menu, and select the version you'd like to install.

    Drop-down menu to choose an action version

  4. To install the action, click Use VERSION.

    Button to install action

  5. Under Choose a repository, select the repository you'd like to install the action on.

    Choose a repository drop-down menu

  6. If your repository already has a workflow, decide whether you want to add the action to the existing workflow or create a new workflow.

    • To add the action to your existing workflow, click the blue dot on the bottom of an existing action and drag to an empty space below until you see an empty box appear.
      Drag to add action to an existing workflow
    • To add the action to a new workflow, click add it to a new workflow.
      Text to add action to a new workflow
  7. To configure your action, click Edit.

    Text to edit action

  8. Configure your action, then click Done. For a complete list of configuration options, see "Action blocks" in the GitHub Developer documentation.

    Options for configuring an action and Done button to finish configuring action

  9. When you've finished editing your workflow, in the upper-right corner, click Start commit.

    Start commit button

  10. Type your commit message, choose a commit email address, and choose a commit branch, then click Propose new file. Committing a workflow enables it for your branch.

    Commit pane and Propose new file button

  11. Type a name and description for your pull request, then click Create pull request.

    Fields and button for creating a pull request

  12. You can see your workflow run on the Checks tab of your pull request.

    Running workflow on the pull request's Checks tab

  13. To enable your workflow for the entire repository, merge your pull request.

To view your enabled workflow and its status, see "Viewing your repository's workflows."

Editing an existing workflow using the visual editor

You can use the visual editor to update your workflow or edit specific actions within your workflow. You can also edit your main.workflow file directly in a text editor.

When you delete a workflow, you'll still be able to see its past runs and status checks. For more information, see "Viewing your repository's workflows."

  1. On GitHub, navigate to the main page of the repository.

  2. In the list of files, click the .github directory, then click main.workflow.

  3. In the upper-right corner of the file view, click .

    Edit icon above the file

  4. To edit your workflow in the visual editor:

    • In the lower-right corner of the workflow or an action within the workflow, click Edit, then edit the configuration or delete the workflow or action.
    • Hover above a blue circle to manually change the relationships between the actions or to create a new action.
  5. When you've finished editing your workflow, in the upper-right corner, click Start commit.

    Start commit button

  6. Type your commit message, choose a commit email address, and choose a commit branch, then click Propose new file. Committing a workflow enables it for your branch.

    Commit pane and Propose new file button

  7. Type a name and description for your pull request, then click Create pull request.

    Fields and button for creating a pull request

  8. You can see your workflow run on the Checks tab of your pull request.

    Running workflow on the pull request's Checks tab

  9. To enable your workflow for the entire repository, merge your pull request.

To view your enabled workflow and its status, see "Viewing your repository's workflows."

Further reading

Ask a human

Can't find what you're looking for?

Contact us