Skip to content

Commit c2afb0c

Browse files
committed
docs(README): note on bundling GitHub Action
1 parent 2823d77 commit c2afb0c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ The Probot application function is defined in [`app.js`](app.js).
3434

3535
The Action will run the [`index.js`](index.js) file which verifies the required environment variables are set, loads the Probot application function and then receives the event from the file system.
3636

37+
**Important:** GitHub Actions do not automatically install npm dependencies. Because you need to use `@probot/github-action` and probably other external dependencies, you need to bundle your app into a single file and reference that file as entry `run.mains` in your `action.yml` file. You can use [ncc](https://github.com/vercel/ncc) for that.
38+
39+
This repository is continuously publishing new versions to the special `v1` branch using [`semantic-release`](github.com/semantic-release/semantic-release). See [package.json](package.json). Relevant bits are
40+
41+
1. `"build": "ncc build index.js -o dist"` script - bundle the app into `dist/index.js`
42+
2. `"release"` - configure publishing from the `"main"` branch, and configure the `git` plugin to add a commit after publishing
43+
44+
The other relevant bit is [`.github/workflows/release.yml`](.github/workflows/release.yml), which is run on each push to the default branch (`main`). It installs all dependencies, runs the `build` script, runs semantic-release which creates the GitHub release based on semantic commit message conventions (`fix: ...`, `feat: ...`) and commits the `dist/index.js` file. Then it pushes the changes to the `v1` branch, so that users will always get the latest version when referencing `probot/exmaple-github-action@v1`. If there should ever be a breaking change, we would change the publish branch to `v2`, etc.
45+
3746
## License
3847

3948
[ISC](LICENSE)

0 commit comments

Comments
 (0)