How to Publish an Action to the Marketplace on Release in GitHub Actions
Publishing an Action means tagging a release and keeping a floating major tag (for example v1) pointing at it so consumers can pin to either.
On a version tag push, create the release, then force-update the major tag (v1) to the same commit so uses: owner/action@v1 resolves to the latest patch.
Steps
- Publish the Action listing once from the release UI (manual, one time).
- On each
vX.Y.Ztag, create the GitHub Release. - Move the
vXmajor tag to the new commit and force-push it.
Workflow
.github/workflows/release.yml
on:
push:
tags: ['v*.*.*']
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
- run: |
MAJOR="${GITHUB_REF_NAME%%.*}"
git tag -f "$MAJOR"
git push -f origin "$MAJOR"Gotchas
- The first Marketplace publish is a manual step in the release UI; the workflow handles later versions.
- A valid
action.ymlwith name, description, and branding is required to list on the Marketplace.
Related guides
How to Create a GitHub Release on Tag Push in GitHub ActionsCreate a GitHub Release automatically when you push a version tag using softprops/action-gh-release, with aut…
How to Bump the Version and Push a Tag Automatically in GitHub ActionsBump the version in package.json and push the matching git tag from GitHub Actions with npm version, configur…