Skip to content

Commit b2c0dc0

Browse files
authored
Merge pull request #20 from urcomputeringpal/jnewland-patch-1
Improve docs
2 parents 4780ca4 + 245b5cd commit b2c0dc0

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ A workflow wrapping https://github.com/actions/github-script with Typescript fun
44

55
## Features
66

7-
- Enables easily running Typescript functions exported from a module like the one in [`.github/`](./.github/) in Actions workflows. Builds and caches build results automatically.
8-
- Allows writing tests for your scripts and running them locally with `npm test`.
7+
- Enables easily running Typescript functions exported from a tiny private module like the one in [`.github/`](./.github/) in Actions workflows. Caches build results automatically.
8+
- Enables a local testing workflow for advanced Actions logic.
99
- Provides a superior experience to editing Javascript embedded in YAML.
1010

1111
## Usage
1212

1313
### Writing scripts
1414

15-
The `@urcomputeringpal/github-script-ts` package contains a type definition for the [arguments](https://github.com/actions/github-script#actionsgithub-script) passed to your script. Put all of these files in `.github` to create scripts of your own:
15+
The [`@urcomputeringpal/github-script-ts`](https://www.npmjs.com/package/@urcomputeringpal/github-script-ts) package contains a type definition for the [arguments](https://github.com/actions/github-script#actionsgithub-script) passed to your script. Put all of these files in `.github` to create scripts of your own:
1616

1717
#### `src/function1.ts`
1818

@@ -66,19 +66,13 @@ export { function1 } from "./function1";
6666

6767
### Running your script in a workflow
6868

69+
See [`action.yml`](./action.yml) for all accepted inputs.
70+
6971
```yaml
7072
- name: Checkout repository
7173
uses: actions/checkout@v3
7274

7375
# Perform setup. Caches build results with actions/cache.
74-
# Expects a package.json with a "build" script that exports
75-
# functions that accept the following arguments
76-
# (see .github/src/types.ts):
77-
#
78-
# * github - A pre-authenticated octokit/rest.js client with pagination plugins
79-
# * context - An object containing the context of the workflow run
80-
# * core - A reference to the @actions/core package
81-
8276
- name: Setup TypeScript scripts
8377
uses: urcomputeringpal/github-script-ts@v0
8478

@@ -91,6 +85,13 @@ export { function1 } from "./function1";
9185
with:
9286
github-token: ${{ secrets.GITHUB_TOKEN }}
9387
function: function1
88+
# args: >
89+
# {github, context, core, exec, io, fetch}
90+
# path: ./.github
91+
# build: npm run build
92+
# module: src/index.js
93+
# result-encoding: string
94+
9495

9596
- name: Use function1 result
9697
run: |

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@urcomputeringpal/github-script-ts",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "actions/github-script for Typescript",
55
"repository": "https://github.com/urcomputeringpal/github-script-ts",
66
"files": [

0 commit comments

Comments
 (0)