mirror of https://github.com/actions/toolkit
update readme
parent
a1c30dfc53
commit
1643ea2734
|
@ -1,5 +1,9 @@
|
||||||
name: toolkit-unit-tests
|
name: toolkit-unit-tests
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'packages/**'
|
||||||
|
- '*.json'
|
||||||
jobs:
|
jobs:
|
||||||
Ubuntu:
|
Ubuntu:
|
||||||
name: Run Ubuntu
|
name: Run Ubuntu
|
43
README.md
43
README.md
|
@ -7,10 +7,15 @@
|
||||||
<a href="https://github.com/actions/toolkit"><img alt="GitHub Actions status" src="https://github.com/actions/toolkit/workflows/toolkit-unit-tests/badge.svg"></a>
|
<a href="https://github.com/actions/toolkit"><img alt="GitHub Actions status" src="https://github.com/actions/toolkit/workflows/toolkit-unit-tests/badge.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
## GitHub Actions Toolkit
|
## GitHub Actions Toolkit
|
||||||
|
|
||||||
The GitHub Actions ToolKit provides a set of packages to make creating actions easier.
|
The GitHub Actions ToolKit provides a set of packages to make creating actions easier.
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<h3 align="center">Get started with the <a href="https://github.com/actions/javascript-action">javascript-action template</a>!</h3>
|
||||||
|
<br/>
|
||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
:heavy_check_mark: [@actions/core](packages/core)
|
:heavy_check_mark: [@actions/core](packages/core)
|
||||||
|
@ -66,6 +71,12 @@ Outlines the differences and why you would want to create a JavaScript or a cont
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
:curly_loop: [Versioning](docs/action-versioning.md)
|
||||||
|
|
||||||
|
Actions are downloaded and run from the GitHub graph of repos. This contains guidance for versioning actions and safe releases.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
[Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
|
[Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
|
||||||
|
|
||||||
Illustrates how to create a simple hello world javascript action.
|
Illustrates how to create a simple hello world javascript action.
|
||||||
|
@ -83,6 +94,13 @@ Illustrates how to create a simple hello world javascript action.
|
||||||
|
|
||||||
Walkthrough and template for creating a JavaScript Action with tests, linting, workflow, publishing, and versioning.
|
Walkthrough and template for creating a JavaScript Action with tests, linting, workflow, publishing, and versioning.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
async function run() {
|
||||||
|
try {
|
||||||
|
const ms = core.getInput('milliseconds');
|
||||||
|
console.log(`Waiting ${ms} milliseconds ...`)
|
||||||
|
...
|
||||||
|
```
|
||||||
```javascript
|
```javascript
|
||||||
PASS ./index.test.js
|
PASS ./index.test.js
|
||||||
✓ throws invalid number
|
✓ throws invalid number
|
||||||
|
@ -107,13 +125,15 @@ async function run() {
|
||||||
const ms = core.getInput('milliseconds');
|
const ms = core.getInput('milliseconds');
|
||||||
console.log(`Waiting ${ms} milliseconds ...`)
|
console.log(`Waiting ${ms} milliseconds ...`)
|
||||||
...
|
...
|
||||||
|
```
|
||||||
|
```javascript
|
||||||
|
PASS ./index.test.js
|
||||||
|
✓ throws invalid number
|
||||||
|
✓ wait 500 ms
|
||||||
|
✓ test runs
|
||||||
|
|
||||||
} catch (error) {
|
Test Suites: 1 passed, 1 total
|
||||||
core.setFailed(error.message);
|
Tests: 3 passed, 3 total
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -124,11 +144,8 @@ Create an action that is delivered as a container and run with docker.
|
||||||
|
|
||||||
```docker
|
```docker
|
||||||
FROM alpine:3.10
|
FROM alpine:3.10
|
||||||
|
|
||||||
COPY LICENSE README.md /
|
COPY LICENSE README.md /
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
```
|
```
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -138,6 +155,12 @@ ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
Create an action that is delivered as a container which uses the toolkit. This example uses the GitHub context to construct an Octokit client.
|
Create an action that is delivered as a container which uses the toolkit. This example uses the GitHub context to construct an Octokit client.
|
||||||
|
|
||||||
|
```docker
|
||||||
|
FROM node:slim
|
||||||
|
COPY . .
|
||||||
|
RUN npm install --production
|
||||||
|
ENTRYPOINT ["node", "/lib/main.js"]
|
||||||
|
```
|
||||||
```javascript
|
```javascript
|
||||||
const myInput = core.getInput('myInput');
|
const myInput = core.getInput('myInput');
|
||||||
core.debug(`Hello ${myInput} from inside a container`);
|
core.debug(`Hello ${myInput} from inside a container`);
|
||||||
|
@ -148,8 +171,6 @@ Create an action that is delivered as a container which uses the toolkit. This
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
:curly_loop: [Versioning](docs/action-versioning.md)
|
|
||||||
|
|
||||||
Recommendations on versioning, releases and tagging your action.
|
Recommendations on versioning, releases and tagging your action.
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
Loading…
Reference in New Issue