Getting your GitHub Action detected
/ 2 min read
Table of Contents
The issue
Adding new GitHub Actions to the repository usually happens on a feature branch: the changes must be reviewed before merge after all.
Or what, if you work on a feature and rename the file of a GitHub Action?
Developers who do one of these two things and expect to find the new action in the GUI of GitHub will be disappointed.
The new/renamed action simply wonβt show up.
How can the new code be tested, without messing up main
?
The solution
In either you have to do the same:
First, create a dummy file with the correct name on main
so it exists in the context of the repository.
An empty file is not enough, though!
To successfully register, the action requires two entries:
- a
name
- a trigger - I recommend a manual trigger for easier testing.
For successful runs, more entries are required:
jobs
- at least one named job
runs-on
- steps
- at least one step that does something, e.g.
echo 'Hi!'
However, this post is not about successful runs. It is about making the action visible, so you can add the missing code on your feature branch.
Minimal example
name: 'My new or renamed action'on: workflow_dispatch: