Example Action is a companion to Package GitHub Actions automatically with GitHub Actions which describes how to automatically package GitHub Actions using GitHub Actions, as an alternative GitHub's recommended strategy.
-
package-action.yml
Package Action usingncc
to create a singledist
-
sync-release-branch.yml
Synchronise To Release Branch on push tomain
-
test.yml
Test Action with jest for unit and GitHub Workflow for integration -
validate-tag.yml
Limit Tags To Distributable Commits by removing tags on commits withoutdist
- Fork the repository
- Create a
release
branch frommain
- Add a commit key (secret, deploy key)
- Push changes to
main
and observerelease
is updated with changes
- Push changes to
greeter.ts
onmain
and observerelease
is updated with a newdist
build
- Tag a release on
main
and observe it is removed - Tag a release on
release
and observe it is persisted
on: [push]
jobs:
greet-people:
runs-on: ubuntu-latest
steps:
- id: greeting-actor
uses: ./
- name: Greet the user that initiated the workflow run
run: echo {{ steps.greeting-actor.outputs.greeting }} # Hello, shrink!
- id: greeting-person
uses: ./
with:
name: "Alice T. Ester"
- name: Greet the person identified by name
run: echo {{ steps.greeting-person.outputs.greeting }} # Hello, Alice T. Ester!