nowox
nowox

Reputation: 29096

How to test GitHub CI without tons of push?

When I create a new workflow with GitHub Actions I have this cumbersome workflow:

  1. Edit .github/workflows/ci.yml
  2. git commit --amend -mhope
  3. git push -f
  4. Goto my browser, hit F5, click on the workflow and pray
  5. Pull off some hairs from my old head and eventually goto 1

Is there any better alternative?

Upvotes: 8

Views: 3480

Answers (2)

Cardinal
Cardinal

Reputation: 2175

If you want to test the whole workflow locally there is beautiful act project.

For testing an individual GitHub Action there is github-action-ts-run-api project.

Upvotes: 1

jidicula
jidicula

Reputation: 3929

You can add a workflow_dispatch event to your on: directive. This allows you to trigger the workflow from the Actions panel in your repo. Once you've finished testing it, you can remove the trigger from your workflow YAML.

The trigger in the Actions panel looks like this (bottom right "Run workflow"):

enter image description here

Upvotes: 6

Related Questions