Skip to content

Commit 72b67c7

Browse files
committed
Github parameter action implementation
1 parent aca103b commit 72b67c7

24 files changed

Lines changed: 4756 additions & 1433 deletions

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# top-most editorconfig file
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[{*.yml,*.yaml,package.json}]
13+
indent_style = space
14+
indent_size = 2

.eslintrc.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
{
2-
"env": {
3-
"commonjs": true,
4-
"es6": true,
5-
"jest": true,
6-
"node": true
7-
},
8-
"extends": "eslint:recommended",
9-
"globals": {
10-
"Atomics": "readonly",
11-
"SharedArrayBuffer": "readonly"
12-
},
13-
"parserOptions": {
14-
"ecmaVersion": 2018
15-
},
16-
"rules": {
17-
}
2+
"env": {
3+
"commonjs": true,
4+
"es6": true,
5+
"jest": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"airbnb-base"
11+
],
12+
"globals": {
13+
"Atomics": "readonly",
14+
"SharedArrayBuffer": "readonly"
15+
},
16+
"parserOptions": {
17+
"ecmaVersion": 2018
18+
},
19+
"rules": {}
1820
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ typings/
6565

6666
# next.js build output
6767
.next
68+
69+
# Mac OS files
70+
.DS_Store

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run prepare
5+
git add dist

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 GitHub Actions
3+
Copyright (c) 2023 Nullplatform Technologies
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
# Create a JavaScript Action
1+
# Nullplatform Parameter GitHub Action
22

33
<p align="center">
4-
<a href="https://github.com/actions/javascript-action/actions"><img alt="javscript-action status" src="https://github.com/actions/javascript-action/workflows/units-test/badge.svg"></a>
4+
<a href="https://github.com/nullplatform/github-action-parameter/actions"><img alt="javascript-action status" src="https://github.com/nullplatform/github-action-parameter/workflows/units-test/badge.svg"></a>
55
</p>
66

7-
Use this template to bootstrap the creation of a JavaScript action.:rocket:
7+
You can use the GitHub Action to query Nullplatform application build parameter
88

9-
This template includes tests, linting, a validation workflow, publishing, and versioning guidance.
10-
11-
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
12-
13-
## Create an action from this template
14-
15-
Click the `Use this Template` and provide the new repo details for your action
16-
17-
## Code in Main
9+
## Code
1810

1911
Install the dependencies
2012

@@ -28,9 +20,9 @@ Run the tests :heavy_check_mark:
2820
$ npm test
2921

3022
PASS ./index.test.js
31-
✓ throws invalid number (3ms)
32-
wait 500 ms (504ms)
33-
test runs (95ms)
23+
✓ throws invalid asset (3ms)
24+
creates asset on nullplatform (504ms)
25+
other test (95ms)
3426
...
3527
```
3628

@@ -66,51 +58,21 @@ See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/R
6658

6759
## Package for distribution
6860

69-
GitHub Actions will run the entry point from the action.yml. Packaging assembles the code into one file that can be checked in to Git, enabling fast and reliable execution and preventing the need to check in node_modules.
70-
71-
Actions are run from GitHub repos. Packaging the action will create a packaged action in the dist folder.
72-
73-
Run prepare
74-
75-
```bash
76-
npm run prepare
77-
```
78-
79-
Since the packaged index.js is run from the dist folder.
80-
81-
```bash
82-
git add dist
83-
```
84-
85-
## Create a release branch
86-
87-
Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.
88-
89-
Checkin to the v1 release branch
61+
Update version in ``package.json`` file and then run:
9062

9163
```bash
92-
git checkout -b v1
93-
git commit -a -m "v1 release"
64+
npm run update:version
9465
```
9566

96-
```bash
97-
git push origin v1
98-
```
99-
100-
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.
101-
102-
Your action is now published! :rocket:
103-
104-
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
105-
10667
## Usage
10768

10869
You can now consume the action by referencing the v1 branch
10970

11071
```yaml
111-
uses: actions/javascript-action@v1
72+
uses: nullplatform/github-action-asset@v1
11273
with:
113-
milliseconds: 1000
74+
name: ${{ secrets.NULLPLATFORM_API_KEY }}
75+
type: docker-image
11476
```
11577
11678
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket:

action.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: 'Wait'
2-
description: 'Wait a designated number of milliseconds'
1+
name: "Nullplatform Parameter"
2+
description: "Github Action for query Nullplatform application build parameter"
33
inputs:
4-
milliseconds: # id of input
5-
description: 'number of milliseconds to wait'
4+
application-id:
5+
description: "The application id to query build parameters"
66
required: true
7-
default: '1000'
8-
outputs:
9-
time: # output will be available to future steps
10-
description: 'The current time after waiting'
7+
name:
8+
description: "The parameter name to query"
9+
required: false
1110
runs:
12-
using: 'node16'
13-
main: 'dist/index.js'
11+
using: "node16"
12+
main: "dist/index.js"

0 commit comments

Comments
 (0)