Skip to content

Commit 8a716c5

Browse files
committed
Release the beast 😈
1 parent fe2a26d commit 8a716c5

File tree

11 files changed

+6563
-5316
lines changed

11 files changed

+6563
-5316
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "units-test"
1+
name: 'test'
22
on:
33
pull_request:
44
push:
@@ -8,18 +8,9 @@ on:
88

99
jobs:
1010
# unit tests
11-
units:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
- run: npm ci
16-
- run: npm test
17-
18-
# test action works running from the graph
1911
test:
2012
runs-on: ubuntu-latest
2113
steps:
22-
- uses: actions/checkout@v2
23-
- uses: ./
24-
with:
25-
milliseconds: 1000
14+
- uses: actions/checkout@v2
15+
- run: npm ci
16+
- run: npm run all

LICENSE

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
MIT License
2-
3-
Copyright (c) 2019 GitHub Actions
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.
1+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2+
Version 2, December 2004
3+
4+
Copyright (C) 2020 Stanley Nguyen <[email protected]>
5+
6+
Everyone is permitted to copy and distribute verbatim or modified
7+
copies of this license document, and changing it is allowed as long
8+
as the name is changed.
9+
10+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12+
13+
0. You just DO WHAT THE FUCK YOU WANT TO.

README.md

Lines changed: 17 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,29 @@
1-
# Create a JavaScript Action
1+
<p align="center"><a href="https://github.com/stanleynguyen/thanos" target="_blank"><img width="500"src="https://media.giphy.com/media/LOoaJ2lbqmduxOaZpS/giphy.gif"></a></p>
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>
5-
</p>
4+
<a href="https://github.com/stanleynguyen/thanos/releases/latest"><img src="https://img.shields.io/github/release/stanleynguyen/thanos.svg"/></a>
5+
<a href="https://github.com/stanleynguyen/thanos/actions?query=workflow%3Atest"><img src="https://github.com/stanleynguyen/thanos/workflows/test/badge.svg"/></a>
6+
<a href="https://github.com/stanleynguyen/thanos/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-WTF-green.svg"/></a>
7+
<p>
68

7-
Use this template to bootstrap the creation of a JavaScript action.:rocket:
9+
# Thanos Snap
810

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
18-
19-
Install the dependencies
20-
21-
```bash
22-
npm install
23-
```
24-
25-
Run the tests :heavy_check_mark:
26-
27-
```bash
28-
$ npm test
29-
30-
PASS ./index.test.js
31-
✓ throws invalid number (3ms)
32-
wait 500 ms (504ms)
33-
test runs (95ms)
34-
...
35-
```
36-
37-
## Change action.yml
38-
39-
The action.yml contains defines the inputs and output for your action.
40-
41-
Update the action.yml with your name, description, inputs and outputs for your action.
42-
43-
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
44-
45-
## Change the Code
46-
47-
Most toolkit and CI/CD operations involve async operations so the action is run in an async function.
48-
49-
```javascript
50-
const core = require('@actions/core');
51-
...
52-
53-
async function run() {
54-
try {
55-
...
56-
}
57-
catch (error) {
58-
core.setFailed(error.message);
59-
}
60-
}
61-
62-
run()
63-
```
64-
65-
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
66-
67-
## Package for distribution
68-
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
7711
```
78-
79-
Since the packaged index.js is run from the dist folder.
80-
81-
```bash
82-
git add dist
12+
👽 : 'Did you do it?'
13+
😈 : 'Yes'
14+
👽 : 'What did it cost?'
15+
😈 : 'Everything...'
8316
```
8417

85-
## Create a release branch
18+
Every project should be perfectly balanced, as all things should be. Snap your project today!
8619

87-
Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.
20+
Checkout this [perfectly balanced demo project](https://github.com/stanleynguyen/thanos-demo).
8821

89-
Checkin to the v1 release branch
90-
91-
```bash
92-
git checkout -b v1
93-
git commit -a -m "v1 release"
94-
```
95-
96-
```bash
97-
git push origin v1
98-
```
99-
100-
Your action is now published! :rocket:
101-
102-
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
103-
104-
## Usage
105-
106-
You can now consume the action by referencing the v1 branch
22+
## 👌🖐
10723

10824
```yaml
109-
uses: actions/javascript-action@v1
110-
with:
111-
milliseconds: 1000
25+
- name: Thanos Snap
26+
uses: stanleynguyen/thanos@snap
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
11229
```
113-
114-
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket:

action.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: 'Wait'
2-
description: 'Wait a designated number of milliseconds'
1+
name: Thanos Snap
2+
description: 'Achieve the perfect balance for your projects'
3+
author: 'Stanley Nguyen'
4+
branding:
5+
icon: 'git-commit'
6+
color: 'purple'
37
inputs:
4-
milliseconds: # id of input
5-
description: 'number of milliseconds to wait'
8+
github-token:
9+
description: 'Pass in secrets.GITHUB_TOKEN'
610
required: true
7-
default: '1000'
8-
outputs:
9-
time: # output will be available to future steps
10-
description: 'The message to output'
1111
runs:
1212
using: 'node12'
1313
main: 'dist/index.js'

0 commit comments

Comments
 (0)