Skip to content

Commit 2324a6f

Browse files
Initial commit
0 parents  commit 2324a6f

File tree

8 files changed

+118
-0
lines changed

8 files changed

+118
-0
lines changed

.github/CODEOWNERS

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

.github/workflows/validate.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: validate
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request:
7+
branches:
8+
- '*'
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
jobs:
15+
validate:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, windows-latest, macos-latest ]
21+
steps:
22+
- uses: actions/checkout@v4
23+
- run: echo "hello world"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 RageAgainstThePixel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# github-action-js-template
2+
3+
A GitHub Actions template repository for JavaScript based Actions
4+
5+
## How to use
6+
7+
### workflow
8+
9+
```yaml
10+
steps:
11+
- uses: RageAgainstThePixel/<github-action>@v1
12+
```
13+
14+
### inputs
15+
16+
| name | description | required |
17+
| ---- | ----------- | -------- |
18+
| .... | ........... | ........ |
19+
20+
### outputs

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: <github-action>
2+
description: 'A GitHub Actions template repository for JavaScript based Actions'
3+
# inputs:
4+
# outputs:
5+
runs:
6+
using: 'node20'
7+
main: 'dist/index.js'
8+
#post: 'dist/index.js'

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "<github-action>",
3+
"version": "1.0.0",
4+
"description": "A GitHub Actions template repository for JavaScript based Actions",
5+
"author": "RageAgainstThePixel",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/RageAgainstThePixel/<github-action>.git"
10+
},
11+
"bugs": {
12+
"url": "https://github.com/RageAgainstThePixel/<github-action>/issues"
13+
},
14+
"homepage": "https://github.com/RageAgainstThePixel/<github-action>",
15+
"main": "dist/index.js",
16+
"keywords": [],
17+
"dependencies": {
18+
"@actions/core": "^1.10.1"
19+
},
20+
"devDependencies": {
21+
"@vercel/ncc": "^0.34.0"
22+
},
23+
"scripts": {
24+
"test": "echo \"Error: no test specified\" && exit 1",
25+
"build": "npm install && npm ci && ncc build src/index.js -o dist --source-map --license licenses.txt"
26+
}
27+
}

src/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const core = require('@actions/core');
2+
3+
const IS_POST = !!core.getState('isPost');
4+
5+
const main = async () => {
6+
try {
7+
if (!IS_POST) {
8+
core.info('Hello World!');
9+
} else {
10+
core.info('Hello World! (post)');
11+
}
12+
} catch (error) {
13+
core.setFailed(error);
14+
}
15+
}
16+
17+
main();

0 commit comments

Comments
 (0)