You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`./action.yml`](./action.yml)| This composite action calls on other Khan actions to prepare a list of changed files. |
15
+
|[`./actions/verify-per-package/action.yml`](./actions/verify-per-package/action.yml)| This ts action contains its logic to [`./src/main.ts`](./src/main.ts). It checks for packages corresponding to changed files, then determines if there is a match for each in changesets. |
14
16
15
-
## Create Your Own Action
17
+
## When Making Changes
16
18
17
-
To create your own action, you can use this repository as a template! Just
18
-
follow the below instructions:
19
+
Please run `yarn all` to ensure that it builds and that all tests pass.
19
20
20
-
1. Click the **Use this template** button at the top of the repository
21
-
1. Select **Create a new repository**
22
-
1. Select an owner and name for your new repository
23
-
1. Click **Create repository**
24
-
1. Clone your new repository
25
-
26
-
## Initial Setup
27
-
28
-
After you've cloned the repository to your local machine or codespace, you'll
29
-
need to perform some initial setup steps before you can develop your action.
30
-
31
-
> [!NOTE]
32
-
>
33
-
> You'll need to have a reasonably modern version of
34
-
> [Node.js](https://nodejs.org) handy. If you are using a version manager like
35
-
> [`nodenv`](https://github.com/nodenv/nodenv) or
36
-
> [`nvm`](https://github.com/nvm-sh/nvm), you can run `nodenv install` in the
37
-
> root of your repository to install the version specified in
38
-
> [`package.json`](./package.json). Otherwise, 20.x or later should work!
39
-
40
-
1.:hammer_and_wrench: Install the dependencies
41
-
42
-
```bash
43
-
npm install
44
-
```
45
-
46
-
1.:building_construction: Package the TypeScript for distribution
47
-
48
-
```bash
49
-
npm run bundle
50
-
```
51
-
52
-
1.:white_check_mark: Run the tests
53
-
54
-
```bash
55
-
$ npm test
56
-
57
-
PASS ./index.test.js
58
-
✓ throws invalid number (3ms)
59
-
✓ wait 500 ms (504ms)
60
-
✓ test runs (95ms)
61
-
62
-
...
63
-
```
64
-
65
-
## Update the Action Metadata
66
-
67
-
The [`action.yml`](action.yml) file defines metadata about your action, such as
68
-
input(s) and output(s). For details about this file, see
69
-
[Metadata syntax for GitHub Actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions).
70
-
71
-
When you copy this repository, update `action.yml` with the name, description,
72
-
inputs, and outputs for your action.
73
-
74
-
## Update the Action Code
75
-
76
-
The [`src/`](./src/) directory is the heart of your action! This contains the
77
-
source code that will be run when your action is invoked. You can replace the
78
-
contents of this directory with your own code.
79
-
80
-
There are a few things to keep in mind when writing your action code:
81
-
82
-
- Most GitHub Actions toolkit and CI/CD operations are processed asynchronously.
83
-
In `main.ts`, you will see that the action is run in an `async` function.
84
-
85
-
```javascript
86
-
import*ascorefrom'@actions/core'
87
-
//...
88
-
89
-
asyncfunctionrun() {
90
-
try {
91
-
//...
92
-
} catch (error) {
93
-
core.setFailed(error.message)
94
-
}
95
-
}
96
-
```
97
-
98
-
For more information about the GitHub Actions toolkit, see the
0 commit comments