Skip to content

Commit 8d6897f

Browse files
committed
Initial release
0 parents  commit 8d6897f

File tree

5,715 files changed

+904465
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,715 files changed

+904465
-0
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"commonjs": true,
5+
"es2021": true,
6+
"jest":true
7+
},
8+
"extends": "eslint:recommended",
9+
"overrides": [
10+
],
11+
"parserOptions": {
12+
"ecmaVersion": "latest"
13+
},
14+
"rules": {
15+
"indent": [
16+
"error",
17+
"tab"
18+
],
19+
"quotes": [
20+
"error",
21+
"single"
22+
],
23+
"semi": [
24+
"error",
25+
"never"
26+
]
27+
}
28+
}

.github/workflows/test.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Unit Test"
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
# unit tests
10+
unit-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- run: npm run test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Xendit https://xendit.co
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

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Xendit API Key Scanner
2+
Xendit API Key Scanner is a Github action to detect Xendit API Key in the pull request.
3+
The action will fail if there is any detected Xendit API Key in the changed code in a spesific pull request. The action will give the detail path in Pull Request Comment.
4+
5+
Example of PR Comment :
6+
<img src="docs/pr_comment.png">
7+
8+
## Inputs
9+
- `github-token` (Optional) Github token to create PR Comment. By default using github token provided by github action.
10+
11+
## How to use
12+
1. Create config inside `.github/workflow` folder.
13+
example config :
14+
```
15+
name: 'Test - Xendit API Key Detector Action'
16+
17+
on: pull_request
18+
jobs:
19+
scan_job:
20+
runs-on: ubuntu-latest
21+
name: Xendit API Key Detector Action
22+
steps:
23+
- name: Scan Job
24+
uses: xendit/xendit-api-key-scanner-action@v1.0.0
25+
```
26+
using custom `gihtub-token` input (optional) :
27+
```
28+
name: 'Test - Xendit API Key Detector Action'
29+
30+
on: pull_request
31+
jobs:
32+
scan_job:
33+
runs-on: ubuntu-latest
34+
name: Xendit API Key Detector Action
35+
steps:
36+
- name: Scan Job
37+
uses: xendit/xendit-api-key-scanner-action@v1.0.0
38+
with:
39+
github-token: <github-token>
40+
```
41+
2. Create pull request to test the action
42+
43+
## Limitation
44+
45+
1. Only detect in the Pull Request trigger
46+
47+
## Contributing
48+
49+
Running test suite
50+
```bash
51+
npm install
52+
npm run test
53+
```
54+
Run before open pull request
55+
```bash
56+
npm run prepare
57+
```
58+
For any requests, bug or comments, please [open an issue](https://github.com/xendit/xendit-api-key-scanner-action/issues) or [submit a pull request](https://github.com/xendit/xendit-api-key-scanner-action/pulls).

action.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Xendit API Key Detector'
2+
description: 'Detect xendit / iluma / instamoney API Key in Pull Request.'
3+
inputs:
4+
github-token:
5+
description: 'Github Token to generate Pull Request Comment'
6+
default: ${{ github.token }}
7+
runs:
8+
using: 'node16'
9+
main: 'dist/index.js'

0 commit comments

Comments
 (0)