mirror of
https://github.com/peter-evans/repository-dispatch.git
synced 2026-06-26 14:16:18 +00:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce5485de42 | ||
|
|
eed51ed4c3 | ||
|
|
938c2224dd | ||
|
|
d1b7bfe3a6 | ||
|
|
8031fbaca8 | ||
|
|
f1680f525a | ||
|
|
5fda2f7d98 | ||
|
|
031f27b115 | ||
|
|
c49e1666ac | ||
|
|
111788c696 | ||
|
|
f131b1d1f9 | ||
|
|
95531d6358 | ||
|
|
b4caad9acd | ||
|
|
543acfac4e | ||
|
|
1b0d3fa47b | ||
|
|
6de120f0ca | ||
|
|
1f8e017ab8 | ||
|
|
4e1995c760 | ||
|
|
7d5ca7bf80 | ||
|
|
618fe4e18f | ||
|
|
8f8aeefe6e | ||
|
|
c5318edea4 | ||
|
|
438514a476 | ||
|
|
216dea92e3 | ||
|
|
c0fe68ba01 | ||
|
|
21c5610af0 | ||
|
|
754562405e | ||
|
|
a12578c2e0 | ||
|
|
0e075ee1a0 | ||
|
|
3b28b4b04f | ||
|
|
9e58632f8a | ||
|
|
163f36102f | ||
|
|
4532a8fb51 | ||
|
|
f540f114fd | ||
|
|
1c51dc3383 | ||
|
|
8e9f439e9f |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -76,11 +76,9 @@ jobs:
|
|||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v2
|
uses: peter-evans/create-pull-request@v3
|
||||||
with:
|
with:
|
||||||
commit-message: Update distribution
|
commit-message: Update distribution
|
||||||
committer: GitHub <noreply@github.com>
|
|
||||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
|
||||||
title: Update distribution
|
title: Update distribution
|
||||||
body: |
|
body: |
|
||||||
- Updates the distribution for changes on `master`
|
- Updates the distribution for changes on `master`
|
||||||
|
|||||||
2
.github/workflows/slash-command-dispatch.yml
vendored
2
.github/workflows/slash-command-dispatch.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v1
|
uses: peter-evans/slash-command-dispatch@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
config: >
|
config: >
|
||||||
|
|||||||
2
.github/workflows/update-dep.yml
vendored
2
.github/workflows/update-dep.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
npx -p npm-check-updates ncu -u
|
npx -p npm-check-updates ncu -u
|
||||||
npm install
|
npm install
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v2
|
uses: peter-evans/create-pull-request@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
commit-message: Update dependencies
|
commit-message: Update dependencies
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ A GitHub action to create a repository dispatch event.
|
|||||||
|
|
||||||
| Name | Description | Default |
|
| Name | Description | Default |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `token` | (**required**) A `repo` scoped GitHub [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). See [token](#token) for further details. | |
|
| `token` | (**required**) A `repo` scoped GitHub [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). See [token](#token) for further details. | |
|
||||||
| `repository` | The full name of the repository to send the dispatch. | `github.repository` (current repository) |
|
| `repository` | The full name of the repository to send the dispatch. | `github.repository` (current repository) |
|
||||||
| `event-type` | (**required**) A custom webhook event name. | |
|
| `event-type` | (**required**) A custom webhook event name. | |
|
||||||
| `client-payload` | JSON payload with extra information about the webhook event that your action or workflow may use. | `{}` |
|
| `client-payload` | JSON payload with extra information about the webhook event that your action or workflow may use. | `{}` |
|
||||||
@@ -26,7 +26,7 @@ A GitHub action to create a repository dispatch event.
|
|||||||
#### `token`
|
#### `token`
|
||||||
|
|
||||||
This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events.
|
This action creates [`repository_dispatch`](https://developer.github.com/v3/repos/#create-a-repository-dispatch-event) events.
|
||||||
The default `GITHUB_TOKEN` does not have scopes to do this so a `repo` scoped [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) is required.
|
The default `GITHUB_TOKEN` does not have scopes to do this so a `repo` scoped [PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) created on a user with `write` access to the target repository is required.
|
||||||
If you will be dispatching to a public repository then you can use the more limited `public_repo` scope.
|
If you will be dispatching to a public repository then you can use the more limited `public_repo` scope.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
|
|
||||||
### Dispatch to multiple repositories
|
### Dispatch to multiple repositories
|
||||||
|
|
||||||
You can dispatch to multiple repositories by using a [matrix strategy](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy). In the following example, after the `build` job succeeds, an event is dispatched to three different repositories.
|
You can dispatch to multiple repositories by using a [matrix strategy](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix). In the following example, after the `build` job succeeds, an event is dispatched to three different repositories.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
jobs:
|
jobs:
|
||||||
@@ -107,6 +107,8 @@ The following payload will succeed.
|
|||||||
client-payload: '{"github": ${{ toJson(github) }}}'
|
client-payload: '{"github": ${{ toJson(github) }}}'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Additionally, there is a limitation on the total data size of the `client-payload`. A very large payload may result in a `client_payload is too large` error.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT](LICENSE)
|
[MIT](LICENSE)
|
||||||
|
|||||||
15056
dist/index.js
vendored
15056
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
5656
package-lock.json
generated
5656
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -27,22 +27,22 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/peter-evans/repository-dispatch#readme",
|
"homepage": "https://github.com/peter-evans/repository-dispatch#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.2.4",
|
"@actions/core": "1.2.6",
|
||||||
"@actions/github": "3.0.0"
|
"@actions/github": "4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "25.2.3",
|
"@types/jest": "26.0.15",
|
||||||
"@types/node": "14.0.10",
|
"@types/node": "14.14.6",
|
||||||
"@typescript-eslint/parser": "3.1.0",
|
"@typescript-eslint/parser": "4.6.1",
|
||||||
"@zeit/ncc": "0.22.3",
|
"@vercel/ncc": "0.24.1",
|
||||||
"eslint": "7.1.0",
|
"eslint": "7.12.1",
|
||||||
"eslint-plugin-github": "4.0.1",
|
"eslint-plugin-github": "4.1.1",
|
||||||
"eslint-plugin-jest": "23.13.2",
|
"eslint-plugin-jest": "24.1.0",
|
||||||
"jest": "26.0.1",
|
"jest": "26.6.3",
|
||||||
"jest-circus": "26.0.1",
|
"jest-circus": "26.6.3",
|
||||||
"js-yaml": "3.14.0",
|
"js-yaml": "3.14.0",
|
||||||
"prettier": "2.0.5",
|
"prettier": "2.1.2",
|
||||||
"ts-jest": "26.1.0",
|
"ts-jest": "26.4.3",
|
||||||
"typescript": "3.9.3"
|
"typescript": "4.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ async function run(): Promise<void> {
|
|||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.debug(inspect(error))
|
core.debug(inspect(error))
|
||||||
core.setFailed(error.message)
|
if (error.status == 404) {
|
||||||
|
core.setFailed(
|
||||||
|
'Repository not found, OR token has insufficient permissions.'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
core.setFailed(error.message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user