My Workflow
The project unfor19/hero-action is an All-In-One action to a test GitHub Action.
Submission Categories
- Maintainer Must-Haves
- Wacky Wildcards - I'm adding this one because it's a "hacky" way of using GitHub Actions to test an action (feels like a recursion)
Yaml File or Link to Code
unfor19 / hero-action
All-in-one action to develop and maintain GitHub Actions.
hero-action
An All-In-One action to test a GitHub Action.
Tested in unfor19/hero-action-test
Usage
- Generate a new Personal Access Token with the scope: repo + workflow. Keep this token in a safe place we'll use it later on.
- Add the following workflow
.github/workflows/testing.yml
to your action's repository, e.g.hero-action
name: testing on: push: branches: [master] paths-ignore: - "README.md" workflow_dispatch: jobs: dispatch_test_action: name: Dispatch Test Action runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: Workflow Dispatch Status uses: unfor19/hero-action@v1.0.2 with: action: "dispatch-status" src_repository: ${{ github.repository }} src_workflow_name: ${{ github.workflow }} src_sha: ${{ github.sha }} target_repository: ${{ github.repository }}-test target_workflow_name: "test-action.yml" gh_token: ${{ secrets.GH_TOKEN }} # scope: repo + workflow
- Create a new GitHub repository to test your action, e.g.
hero-action-test
, add…
- The action repository,
my-repo
, triggers a workflow in the test repository,my-repo-test
. Meanwhile, themy-repo
is "stuck" with the commit status pending. - The repository
my-repo-test
tests the action by using it, see unfor19/hero-action-test - Upon success/failure, the test action
my-repo-test
creates a commit status in the action's repository, this updates the status of the pending workflow with success or failure
Additional Resources / Info
- Using this action in:
Top comments (2)
Great article. I'm a beginner and like this developer very much. Where can I learn the most basic development courses?
Thank you!
What's purpose? The "development course" should be picked according to your goals/needs