skip to content
blog.metters.dev
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:

  1. a name
  2. a trigger - I recommend a manual trigger for easier testing.

For successful runs, more entries are required:

  1. jobs
  2. at least one named job
  3. runs-on
  4. steps
  5. 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

minimal-new-or-renamed-action.yml
name: 'My new or renamed action'
on:
workflow_dispatch: