Skip to content

Commit bd499b5

Browse files
committed
Merge branch 'actions-main'
2 parents 12636d2 + 720ab2d commit bd499b5

20 files changed

+3268
-2690
lines changed

.eslintignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
dist/
22
lib/
3-
node_modules/
3+
<<<<<<< HEAD
4+
node_modules/
5+
=======
6+
node_modules/
7+
jest.config.js
8+
>>>>>>> actions-main

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"project": "./tsconfig.json"
99
},
1010
"rules": {
11+
<<<<<<< HEAD
12+
=======
13+
"i18n-text/no-en": "off",
14+
>>>>>>> actions-main
1115
"eslint-comments/no-use": "off",
1216
"import/no-namespace": "off",
1317
"no-unused-vars": "off",

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: daily

.github/workflows/check-dist.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# `dist/index.js` is a special file in Actions.
2+
# When you reference an action with `uses:` in a workflow,
3+
# `index.js` is the code that will run.
4+
# For our project, we generate this file through a build process from other source files.
5+
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
6+
name: Check dist/
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- '**.md'
14+
pull_request:
15+
paths-ignore:
16+
- '**.md'
17+
workflow_dispatch:
18+
19+
jobs:
20+
check-dist:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Set Node.js 12.x
27+
uses: actions/setup-node@v2.5.1
28+
with:
29+
node-version: 12.x
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Rebuild the dist/ directory
35+
run: |
36+
npm run build
37+
npm run package
38+
39+
- name: Compare the expected and actual dist/ directories
40+
run: |
41+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
42+
echo "Detected uncommitted changes after build. See status below:"
43+
git diff
44+
exit 1
45+
fi
46+
id: diff
47+
48+
# If index.js was different than expected, upload the expected version as an artifact
49+
- uses: actions/upload-artifact@v2
50+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
51+
with:
52+
name: dist
53+
path: dist/

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v1
15+
- uses: actions/setup-node@v2
1616
with:
17+
cache: yarn
1718
node-version: 12
1819
- run: yarn install
1920
- run: yarn lint

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm test

.prettierrc.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"printWidth": 80,
3-
"tabWidth": 2,
4-
"useTabs": false,
5-
"semi": true,
6-
"singleQuote": true,
7-
"trailingComma": "es5",
8-
"bracketSpacing": false,
9-
"arrowParens": "avoid",
10-
"parser": "typescript"
11-
}
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": "es5",
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid"
10+
}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @actions/actions-runtime

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
# Create a JavaScript Action using TypeScript
66

7-
Use this template to bootstrap the creation of a JavaScript action.:rocket:
7+
Use this template to bootstrap the creation of a TypeScript action.:rocket:
88

9-
This template includes compilication support, tests, a validation workflow, publishing, and versioning guidance.
9+
This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance.
1010

1111
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
1212

1313
## Create an action from this template
1414

1515
Click the `Use this Template` and provide the new repo details for your action
1616

17-
## Code in Master
17+
## Code in Main
18+
19+
> First, you'll need to have a reasonably modern version of `node` handy. This won't work with versions older than 9, for instance.
1820
1921
Install the dependencies
2022
```bash
@@ -40,7 +42,7 @@ $ yarn test
4042

4143
## Change action.yml
4244

43-
The action.yml contains defines the inputs and output for your action.
45+
The action.yml defines the inputs and output for your action.
4446

4547
Update the action.yml with your name, description, inputs and outputs for your action.
4648

@@ -80,21 +82,23 @@ $ git commit -a -m "prod dependencies"
8082
$ git push origin releases/v1
8183
```
8284

85+
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
86+
8387
Your action is now published! :rocket:
8488

8589
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
8690

8791
## Validate
8892

89-
You can now validate the action by referencing `./` in a workflow in your repo (see [test.yml](.github/workflows/test.yml)])
93+
You can now validate the action by referencing `./` in a workflow in your repo (see [test.yml](.github/workflows/test.yml))
9094

9195
```yaml
9296
uses: ./
9397
with:
9498
milliseconds: 1000
9599
```
96100
97-
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket:
101+
See the [actions tab](https://github.com/actions/typescript-action/actions) for runs of this action! :rocket:
98102
99103
## Usage:
100104

0 commit comments

Comments
 (0)