Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63b31e7

Browse files
committed
Add pre and post command documentation
1 parent 722c829 commit 63b31e7

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## v4
4+
5+
This version adds support for
6+
[`pre`](https://docs.github.com/en/actions/reference/metadata-syntax-for-github-actions#runspre)
7+
and
8+
[`post`](https://docs.github.com/en/actions/reference/metadata-syntax-for-github-actions#runspost)
9+
scripts for actions. These should follow the same structure as the `run` action
10+
code (see the
11+
[`README.md`](https://github.com/github/local-action#action-structure) for more
12+
details).
13+
314
## v3
415

516
This version adds **experimental** support for [pnpm](https://pnpm.io/) and

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,31 +182,35 @@ For additional information about transpiled action code, see
182182
| `-h`, `--help` | Display help information |
183183
| `-V`, `--version` | Display version information |
184184

185-
### `local-action run <path> <logic entrypoint> <dotenv file>`
186-
187-
| Argument | Description |
188-
| ------------------ | ------------------------------------------------------ |
189-
| `path` | Path to the local action directory |
190-
| | Example: `/path/to/action.yml` |
191-
| `logic entrypoint` | Action logic entrypoint (relative to action directory) |
192-
| | Example: `src/main.ts` |
193-
| `dotenv file` | Path to the local `.env` file for action inputs |
194-
| | Example: `/path/to/.env` |
195-
| | See the example [`.env.example`](.env.example) |
185+
### `local-action run <path> <logic entrypoint> <dotenv file> [--pre <pre entrypoint>] [--post <post entrypoint>]`
186+
187+
| Argument | Description |
188+
| -------------------------- | ------------------------------------------------------------------- |
189+
| `path` | Path to the local action directory |
190+
| | Example: `/path/to/action.yml` |
191+
| `logic entrypoint` | Action logic entrypoint (relative to action directory) |
192+
| | Example: `src/main.ts` |
193+
| `dotenv file` | Path to the local `.env` file for action inputs |
194+
| | Example: `/path/to/.env` |
195+
| | See the example [`.env.example`](.env.example) |
196+
| `--pre <pre entrypoint>` | (Optional) `pre` command entrypoint (relative to action directory) |
197+
| | Example: `pre/main.ts` |
198+
| `--post <post entrypoint>` | (Optional) `post` command entrypoint (relative to action directory) |
199+
| | Example: `post/main.ts` |
196200

197201
Examples:
198202

199203
```bash
200-
local-action run /path/to/typescript-action src/main.ts .env
204+
local-action run /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts
201205

202206
# The `run` action is invoked by default as well
203-
local-action /path/to/typescript-action src/main.ts .env
207+
local-action /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts
204208
```
205209

206210
#### Output
207211

208212
```console
209-
$ local-action run /path/to/typescript-action src/main.ts .env
213+
$ local-action run /path/to/typescript-action src/main.ts .env --pre pre/main.ts --post post/main.ts
210214
_ _ _ ____ _
211215
/ \ ___| |_(_) ___ _ __ | _ \ ___| |__ _ _ __ _ __ _ ___ _ __
212216
/ _ \ / __| __| |/ _ \| '_ \ | | | |/ _ \ '_ \| | | |/ _` |/ _` |/ _ \ '__|

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@github/local-action",
33
"description": "Local Debugging for GitHub Actions",
4-
"version": "3.2.1",
4+
"version": "4.0.0",
55
"type": "module",
66
"author": "Nick Alteen <[email protected]>",
77
"private": false,

0 commit comments

Comments
 (0)