|
1 | | -# Create a GitHub Action Using TypeScript |
| 1 | +# Pipelab Github Action |
2 | 2 |
|
3 | 3 | [](https://github.com/super-linter/super-linter) |
4 | 4 |  |
5 | 5 | [](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml) |
6 | 6 | [](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml) |
7 | 7 | [](./badges/coverage.svg) |
8 | 8 |
|
9 | | -Use this template to bootstrap the creation of a TypeScript action. :rocket: |
10 | | - |
11 | | -This template includes compilation support, tests, a validation workflow, |
12 | | -publishing, and versioning guidance. |
13 | | - |
14 | | -If you are new, there's also a simpler introduction in the |
15 | | -[Hello world JavaScript action repository](https://github.com/actions/hello-world-javascript-action). |
16 | | - |
17 | | -## Create Your Own Action |
18 | | - |
19 | | -To create your own action, you can use this repository as a template! Just |
20 | | -follow the below instructions: |
21 | | - |
22 | | -1. Click the **Use this template** button at the top of the repository |
23 | | -1. Select **Create a new repository** |
24 | | -1. Select an owner and name for your new repository |
25 | | -1. Click **Create repository** |
26 | | -1. Clone your new repository |
27 | | - |
28 | | -> [!IMPORTANT] |
29 | | -> |
30 | | -> Make sure to remove or update the [`CODEOWNERS`](./CODEOWNERS) file! For |
31 | | -> details on how to use this file, see |
32 | | -> [About code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners). |
33 | | -
|
34 | | -## Initial Setup |
35 | | - |
36 | | -After you've cloned the repository to your local machine or codespace, you'll |
37 | | -need to perform some initial setup steps before you can develop your action. |
38 | | - |
39 | | -> [!NOTE] |
40 | | -> |
41 | | -> You'll need to have a reasonably modern version of |
42 | | -> [Node.js](https://nodejs.org) handy (20.x or later should work!). If you are |
43 | | -> using a version manager like [`nodenv`](https://github.com/nodenv/nodenv) or |
44 | | -> [`fnm`](https://github.com/Schniz/fnm), this template has a `.node-version` |
45 | | -> file at the root of the repository that can be used to automatically switch to |
46 | | -> the correct version when you `cd` into the repository. Additionally, this |
47 | | -> `.node-version` file is used by GitHub Actions in any `actions/setup-node` |
48 | | -> actions. |
49 | | -
|
50 | | -1. :hammer_and_wrench: Install the dependencies |
51 | | - |
52 | | - ```bash |
53 | | - npm install |
54 | | - ``` |
55 | | - |
56 | | -1. :building_construction: Package the TypeScript for distribution |
57 | | - |
58 | | - ```bash |
59 | | - npm run bundle |
60 | | - ``` |
61 | | - |
62 | | -1. :white_check_mark: Run the tests |
63 | | - |
64 | | - ```bash |
65 | | - $ npm test |
66 | | - |
67 | | - PASS ./index.test.js |
68 | | - ✓ throws invalid number (3ms) |
69 | | - ✓ wait 500 ms (504ms) |
70 | | - ✓ test runs (95ms) |
71 | | - |
72 | | - ... |
73 | | - ``` |
74 | | - |
75 | | -## Update the Action Metadata |
76 | | - |
77 | | -The [`action.yml`](action.yml) file defines metadata about your action, such as |
78 | | -input(s) and output(s). For details about this file, see |
79 | | -[Metadata syntax for GitHub Actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions). |
80 | | - |
81 | | -When you copy this repository, update `action.yml` with the name, description, |
82 | | -inputs, and outputs for your action. |
83 | | - |
84 | 9 | ## Update the Action Code |
85 | 10 |
|
86 | 11 | The [`src/`](./src/) directory is the heart of your action! This contains the |
|
0 commit comments