-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anthony Di Benedetto
committed
Dec 31, 2020
0 parents
commit 7cd09bd
Showing
13 changed files
with
9,920 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
plugins: [ | ||
'@typescript-eslint', | ||
], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
rules: { | ||
// disable semicolon | ||
'@typescript-eslint/member-delimiter-style': 'off', | ||
// allow use of 'any' | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
// allow explicit type declarations | ||
'@typescript-eslint/no-inferrable-types': 'off' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CI for Repository Dispatch | ||
|
||
on: | ||
repository_dispatch: | ||
types: ['test_dispatch'] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Show received client_payload | ||
env: | ||
CLIENT_PAYLOAD: ${{ toJson(github.event.client_payload) }} | ||
run: | | ||
echo "Client Payload" | ||
echo "$CLIENT_PAYLOAD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: CI | ||
|
||
# This event is triggered on pushes to master & PRs to all branches | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
self-test: | ||
name: Self Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Cloning repository | ||
|
||
- uses: ./ | ||
name: Dispatch Event | ||
id: dispatch_action | ||
with: | ||
eventType: 'test_dispatch' | ||
token: ${{ secrets.REPO_PAT }} | ||
payload: '{"requested_by": "${{github.actor}}"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
*.log | ||
coverage | ||
.nyc_output/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
 | ||
 | ||
|
||
# Action: Repository Dispatch <!-- omit in toc --> | ||
|
||
- [Usage](#usage) | ||
- [Inputs](#inputs) | ||
- [(*) token](#-token) | ||
|
||
# Usage | ||
> :information_source: Check the [ci workflow](.github/workflows/ci.yml) in this repo to see a live example on how to use this action in your own workflow | ||
## Inputs | ||
- `targetRepository`: Full name (`owner/repo-name`) of the repository that will receive the `repository_dispatch` event. | ||
- required: `false` | ||
- default: `${{ github.repository }}` (current repository running the workflow) | ||
|
||
- `eventType`: Custom event type expected by the receiving repository | ||
- required: `true` | ||
- example: `'do-something-awesome'` | ||
|
||
- `token`: A GitHub Personal Access Token (PAT) ([more info](#-token)) | ||
- required: `true` | ||
|
||
- `payload`: Stringified JSON payload | ||
- required: `false` | ||
- default: `'{}'` | ||
- example: `'{"customField": "some value", "anotherField": "another value"}'` | ||
|
||
### (*) token | ||
:information_source: If you are targeting: | ||
- **Public repository**: The PAT only needs `public_repo` scope | ||
- **Private repository**: The PAT needs `repo` scope and its owner needs `write` access in the target repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Repository Dispatch | ||
author: 'Tony DBR' | ||
description: Send customized repository_dispatch events | ||
branding: | ||
color: red | ||
icon: send | ||
|
||
inputs: | ||
targetRepository: | ||
description: Full name (owner/repo-name) of the repository that will receive the repository_dispatch event | ||
required: false | ||
default: ${{ github.respository }} | ||
|
||
eventType: | ||
description: Custom event type expected by the receiving repository | ||
required: true | ||
|
||
token: | ||
description: A GitHub Personal Access Token (PAT) with 'repo' permissions | ||
required: true | ||
|
||
payload: | ||
description: Stringified JSON payload | ||
required: false | ||
default: '{}' | ||
|
||
runs: | ||
using: 'node12' | ||
main: 'dist/index.js' |
Oops, something went wrong.