Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Jul 31, 2024
1 parent 0ff82de commit fc6171d
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @StephenHodgson
18 changes: 18 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: validate
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # Enable triggering the workflow manually from the Actions tab
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- run: echo "hello world"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# github-action-js-template

A GitHub Actions template repository for JavaScript based Actions

## How to use

### workflow

```yaml
steps:
- uses: RageAgainstThePixel/<github-action>@v1
```
### inputs
| name | description | required |
| ---- | ----------- | -------- |
| .... | ........... | ........ |
### outputs
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: <github-action>
description: 'A GitHub Actions template repository for JavaScript based Actions'
# inputs:
# outputs:
runs:
using: 'node20'
main: 'dist/index.js'
#post: 'dist/index.js'
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "<github-action>",
"version": "1.0.0",
"description": "A GitHub Actions template repository for JavaScript based Actions",
"author": "<author>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/<author>/<github-action>.git"
},
"bugs": {
"url": "https://github.com/<author>/<github-action>/issues"
},
"homepage": "https://github.com/<author>/<github-action>",
"main": "dist/index.js",
"keywords": [],
"dependencies": {
"@actions/core": "^1.10.1"
},
"devDependencies": {
"@vercel/ncc": "^0.34.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npm install && npm ci && ncc build src/index.js -o dist --source-map --license licenses.txt"
}
}
17 changes: 17 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const core = require('@actions/core');

const IS_POST = !!core.getState('isPost');

const main = async () => {
try {
if (!IS_POST) {
core.info('Hello World!');
} else {
core.info('Hello World! (post)');
}
} catch (error) {
core.setFailed(error);
}
}

main();

0 comments on commit fc6171d

Please sign in to comment.