Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
xenzun committed Feb 17, 2023
0 parents commit 8d6897f
Show file tree
Hide file tree
Showing 5,715 changed files with 904,465 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
28 changes: 28 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"env": {
"node": true,
"commonjs": true,
"es2021": true,
"jest":true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"indent": [
"error",
"tab"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Unit Test"
on:
pull_request:
push:
branches:
- main

jobs:
# unit tests
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Xendit https://xendit.co

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Xendit API Key Scanner
Xendit API Key Scanner is a Github action to detect Xendit API Key in the pull request.
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.

Example of PR Comment :
<img src="docs/pr_comment.png">

## Inputs
- `github-token` (Optional) Github token to create PR Comment. By default using github token provided by github action.

## How to use
1. Create config inside `.github/workflow` folder.
example config :
```
name: 'Test - Xendit API Key Detector Action'
on: pull_request
jobs:
scan_job:
runs-on: ubuntu-latest
name: Xendit API Key Detector Action
steps:
- name: Scan Job
uses: xendit/[email protected]
```
using custom `gihtub-token` input (optional) :
```
name: 'Test - Xendit API Key Detector Action'
on: pull_request
jobs:
scan_job:
runs-on: ubuntu-latest
name: Xendit API Key Detector Action
steps:
- name: Scan Job
uses: xendit/[email protected]
with:
github-token: <github-token>
```
2. Create pull request to test the action

## Limitation

1. Only detect in the Pull Request trigger

## Contributing

Running test suite
```bash
npm install
npm run test
```
Run before open pull request
```bash
npm run prepare
```
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).
9 changes: 9 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Xendit API Key Detector'
description: 'Detect xendit / iluma / instamoney API Key in Pull Request.'
inputs:
github-token:
description: 'Github Token to generate Pull Request Comment'
default: ${{ github.token }}
runs:
using: 'node16'
main: 'dist/index.js'
Loading

0 comments on commit 8d6897f

Please sign in to comment.