109 Commits

Author SHA1 Message Date
Peter Evans
11ba7d3f32 Merge pull request #106 from peter-evans/v2
Update runtime to node 16
2022-03-22 13:04:34 +09:00
Peter Evans
646aa8008a Fix upload-artifact action version 2022-03-22 12:57:19 +09:00
Peter Evans
8d9724ed37 Update runtime to node 16 2022-03-22 12:54:49 +09:00
Peter Evans
88ec35d633 Merge pull request #95 from peter-evans/rm-workflow
Remove workflow
2022-01-28 11:56:21 +09:00
Peter Evans
7fbda9c715 Remove workflow 2022-01-28 11:54:51 +09:00
Peter Evans
689b4c9c3d Merge pull request #87 from peter-evans/update-distribution
Update distribution
2021-12-02 10:34:36 +09:00
peter-evans
ecb27d1931 Update distribution 2021-12-02 01:34:14 +00:00
Peter Evans
c9a37ac63b Merge pull request #86 from peter-evans/update-dependencies
Update dependencies
2021-12-02 10:33:05 +09:00
actions-bot
e006cbaf4a Update dependencies 2021-12-02 01:24:08 +00:00
Peter Evans
12751c0f0e Merge pull request #84 from peter-evans/dependabot/npm_and_yarn/ansi-regex-5.0.1
Bump ansi-regex from 5.0.0 to 5.0.1
2021-10-07 11:12:42 +09:00
Peter Evans
3a8608a86b Merge pull request #85 from peter-evans/update-distribution
Update distribution
2021-10-07 10:54:12 +09:00
peter-evans
f3e2ad4d6d Update distribution 2021-10-07 01:45:10 +00:00
dependabot[bot]
28a41e5d3f Bump ansi-regex from 5.0.0 to 5.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 01:44:31 +00:00
Peter Evans
59fb538f54 Merge pull request #82 from peter-evans/update-dependencies
Update dependencies
2021-10-07 10:44:03 +09:00
actions-bot
6b9355a6b3 Update dependencies 2021-10-07 01:24:34 +00:00
Peter Evans
0e8ca8c8a5 Merge pull request #80 from peter-evans/update-dependencies
Update dependencies
2021-09-02 13:41:18 +09:00
Peter Evans
1d7df303a4 Set error type to any 2021-09-02 13:35:30 +09:00
actions-bot
48ba398488 Update dependencies 2021-09-02 01:23:05 +00:00
Peter Evans
a3b37769d2 Merge pull request #79 from peter-evans/update-distribution
Update distribution
2021-07-22 11:00:25 +09:00
peter-evans
6c67f6dc34 Update distribution 2021-07-22 01:59:09 +00:00
Peter Evans
c66206b38f Merge pull request #76 from peter-evans/update-dependencies
Update dependencies
2021-07-22 10:57:55 +09:00
actions-bot
5e4869cf56 Update dependencies 2021-07-22 01:25:20 +00:00
Peter Evans
a691d185a6 Merge pull request #74 from peter-evans/update-distribution
Update distribution
2021-05-27 12:47:29 +09:00
peter-evans
2694ce6b01 Update distribution 2021-05-27 02:24:24 +00:00
Peter Evans
d7bf02a0d4 Merge pull request #73 from peter-evans/update-dependencies
Update dependencies
2021-05-27 11:23:21 +09:00
Peter Evans
f43d2e4f9b Update octokit rest methods 2021-05-27 11:21:49 +09:00
actions-bot
0e60b0b03e Update dependencies 2021-05-27 01:31:15 +00:00
Peter Evans
27c539bc8e Merge pull request #72 from peter-evans/update-distribution
Update distribution
2021-05-13 11:19:06 +09:00
peter-evans
80935a6f6a Update distribution 2021-05-13 02:18:35 +00:00
Peter Evans
d410a440ba Merge pull request #66 from peter-evans/update-dependencies
Update dependencies
2021-05-13 11:17:26 +09:00
actions-bot
2a643d2b1d Update dependencies 2021-05-13 02:11:17 +00:00
Peter Evans
f7b4de6b26 Update default branch 2021-05-12 17:29:28 +09:00
Peter Evans
01c34330a7 Merge pull request #69 from peter-evans/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.20 to 4.17.21
2021-05-12 10:03:53 +09:00
Peter Evans
756edddbea Merge pull request #71 from peter-evans/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.8 to 2.8.9
2021-05-12 10:03:45 +09:00
dependabot[bot]
0ca2845ddc Bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 17:26:23 +00:00
dependabot[bot]
a912a66602 Bump lodash from 4.17.20 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 12:43:40 +00:00
Peter Evans
d57191493a Merge pull request #62 from peter-evans/update-dependencies
Update dependencies
2021-04-01 11:13:28 +09:00
Peter Evans
47ba5baae1 Merge pull request #64 from peter-evans/dependabot/npm_and_yarn/y18n-4.0.1
Bump y18n from 4.0.0 to 4.0.1
2021-04-01 11:13:09 +09:00
actions-bot
5c418feb53 Update dependencies 2021-04-01 01:26:49 +00:00
dependabot[bot]
0a654f7a64 Bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 23:02:36 +00:00
Peter Evans
9570c22b4b Merge pull request #60 from peter-evans/update-dependencies
Update dependencies
2021-03-16 12:50:04 +09:00
Peter Evans
d8636578df fix: remove unnecessary prettier config 2021-03-16 12:46:48 +09:00
actions-bot
6f7481a067 Update dependencies 2021-03-11 01:39:41 +00:00
Peter Evans
83b60ccd45 Merge pull request #59 from peter-evans/update-distribution
Update distribution
2021-02-25 11:18:39 +09:00
peter-evans
f5abc260cb Update distribution 2021-02-25 02:16:59 +00:00
Peter Evans
cd5067bcd9 Merge pull request #57 from peter-evans/update-dependencies
Update dependencies
2021-02-25 11:15:52 +09:00
actions-bot
c083ba276e Update dependencies 2021-02-25 01:34:44 +00:00
Peter Evans
12a30d3dee Merge pull request #56 from peter-evans/update-distribution
Update distribution
2020-12-28 10:13:33 +09:00
peter-evans
2960c86134 Update distribution 2020-12-28 01:08:02 +00:00
Peter Evans
2c97fc16cc Merge pull request #52 from peter-evans/update-dependencies
Update dependencies
2020-12-28 10:06:57 +09:00
actions-bot
da8e21ecc8 Update dependencies 2020-12-24 01:59:33 +00:00
Peter Evans
e404a881db Merge pull request #54 from peter-evans/dependabot/npm_and_yarn/node-notifier-8.0.1
Bump node-notifier from 8.0.0 to 8.0.1
2020-12-23 09:47:41 +09:00
dependabot[bot]
259edc5079 Bump node-notifier from 8.0.0 to 8.0.1
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-22 15:58:11 +00:00
Peter Evans
ce5485de42 Merge pull request #51 from peter-evans/not-found-error
Improve error message for 404 errors
2020-11-11 16:12:02 +09:00
Peter Evans
eed51ed4c3 Improve error message for 404 errors 2020-11-11 16:09:35 +09:00
Peter Evans
938c2224dd Merge pull request #46 from peter-evans/update-dependencies
Update dependencies
2020-11-11 15:45:07 +09:00
actions-bot
d1b7bfe3a6 Update dependencies 2020-11-05 01:11:15 +00:00
Peter Evans
8031fbaca8 Merge pull request #48 from peter-evans/update-distribution
Update distribution
2020-10-02 15:16:49 +09:00
peter-evans
f1680f525a Update distribution 2020-10-02 06:09:25 +00:00
Peter Evans
5fda2f7d98 Merge pull request #47 from peter-evans/dependabot/npm_and_yarn/actions/core-1.2.6
Bump @actions/core from 1.2.5 to 1.2.6
2020-10-02 15:07:56 +09:00
dependabot[bot]
031f27b115 Bump @actions/core from 1.2.5 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-01 17:24:37 +00:00
Peter Evans
c49e1666ac Merge pull request #44 from staabm/patch-1
Mention string length limitations
2020-09-24 11:08:22 +09:00
Markus Staab
111788c696 Update README.md 2020-09-24 11:05:07 +09:00
Markus Staab
f131b1d1f9 Update README.md 2020-09-24 11:05:07 +09:00
Peter Evans
95531d6358 Merge pull request #45 from peter-evans/update-distribution
Update distribution
2020-09-22 08:56:42 +09:00
peter-evans
b4caad9acd Update distribution 2020-09-21 23:56:30 +00:00
Peter Evans
543acfac4e Merge pull request #37 from peter-evans/update-dependencies
Update dependencies
2020-09-22 08:55:27 +09:00
Markus Staab
1b0d3fa47b Update README.md 2020-09-19 07:59:30 +02:00
Markus Staab
6de120f0ca Update README.md 2020-09-19 07:58:31 +02:00
Markus Staab
1f8e017ab8 Mention string length limitations 2020-09-19 07:56:36 +02:00
actions-bot
4e1995c760 Update dependencies 2020-09-17 01:13:09 +00:00
Peter Evans
7d5ca7bf80 Merge pull request #43 from peter-evans/update-distribution
Update distribution
2020-09-13 15:09:49 +09:00
peter-evans
618fe4e18f Update distribution 2020-09-13 06:08:13 +00:00
Peter Evans
8f8aeefe6e Merge pull request #42 from peter-evans/dependabot/npm_and_yarn/node-fetch-2.6.1
Bump node-fetch from 2.6.0 to 2.6.1
2020-09-13 15:06:51 +09:00
dependabot[bot]
c5318edea4 Bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-12 10:25:06 +00:00
Peter Evans
438514a476 Merge pull request #41 from peter-evans/update-ncc
Update ncc
2020-08-22 15:29:58 +09:00
Peter Evans
216dea92e3 Update ncc 2020-08-22 15:28:17 +09:00
Peter Evans
c0fe68ba01 Update readme 2020-08-04 15:54:46 +09:00
Peter Evans
21c5610af0 Update slash-command-dispatch to v2 2020-07-25 13:45:08 +09:00
Peter Evans
754562405e Update create-pull-request action to v3 2020-07-23 16:05:30 +09:00
Peter Evans
a12578c2e0 Merge pull request #36 from peter-evans/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-07-20 17:43:59 +09:00
dependabot[bot]
0e075ee1a0 Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-20 08:41:32 +00:00
Peter Evans
3b28b4b04f Merge pull request #35 from peter-evans/update-distribution
Update distribution
2020-07-19 18:06:42 +09:00
peter-evans
9e58632f8a Update distribution 2020-07-19 09:06:12 +00:00
Peter Evans
163f36102f Merge pull request #30 from peter-evans/update-dependencies
Update dependencies
2020-07-19 18:04:45 +09:00
actions-bot
4532a8fb51 Update dependencies 2020-07-16 01:05:50 +00:00
Peter Evans
f540f114fd Update readme 2020-06-25 09:13:39 +09:00
Peter Evans
1c51dc3383 Merge pull request #31 from cbetta/patch-1
Clarify that PAT owner needs to have repo access
2020-06-25 09:12:02 +09:00
Cristiano Betta
8e9f439e9f Clarify that PAT owner needs to have repo access
Ran into an issue where I was using a user that did not have explicit access to the repo that I was trying to trigger an event for. I'm not sure if the user needs write access to the repo, but it seems logical to me that someone with `read` only access can not trigger GH actions.
2020-06-24 14:57:02 +01:00
Peter Evans
1708dda570 Merge pull request #27 from peter-evans/update-dependencies
Update dependencies
2020-06-04 15:28:27 +09:00
Peter Evans
eb329a2e6a Fix for github v3 2020-06-04 15:25:58 +09:00
actions-bot
7aa158e97c Update dependencies 2020-06-04 01:05:19 +00:00
Peter Evans
35f05e8e06 Fix ci artifacts 2020-06-02 18:37:55 +09:00
Peter Evans
f0c6ad7fa3 Fix prettier glob pattern 2020-06-02 18:37:38 +09:00
Peter Evans
fe5946ba71 Update slash command dispatch 2020-06-02 18:37:24 +09:00
Peter Evans
7ecf080487 Update README 2020-05-29 10:21:14 +09:00
Peter Evans
c830a9705e Update README 2020-05-25 18:16:20 +09:00
Peter Evans
ed97383570 Add rebase slash command 2020-05-25 17:30:29 +09:00
Peter Evans
b410ea76d1 Skip test job for pull requests from forks 2020-05-13 17:23:47 +09:00
Peter Evans
7fe6653bc4 Merge pull request #26 from peter-evans/update-distribution
Update distribution
2020-05-13 11:41:29 +09:00
peter-evans
d874befdda Update distribution 2020-05-13 02:41:01 +00:00
Peter Evans
9f64758ff8 Merge pull request #25 from peter-evans/update-dependencies
Update dependencies
2020-05-13 11:39:27 +09:00
actions-bot
e42b4b7b55 Update dependencies 2020-05-07 01:03:09 +00:00
Peter Evans
cb588ee63a Ignore documentation paths 2020-05-06 11:41:48 +09:00
Peter Evans
41bdbb0627 Add update dependencies workflow 2020-05-06 10:00:17 +09:00
Renovate Bot
d47934dfd8 Update dependency @types/node to v13.13.5 2020-05-05 21:45:53 +00:00
Renovate Bot
34d557382e Update jest monorepo to v26.0.1 2020-05-05 12:45:41 +00:00
Peter Evans
a4bb1fc8bc Add ci badge 2020-05-05 14:11:28 +09:00
Peter Evans
f9ec82f96b Update input description 2020-05-05 09:17:05 +09:00
12 changed files with 14858 additions and 29707 deletions

View File

@@ -9,8 +9,7 @@
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"prettier/@typescript-eslint"
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {

8
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"

View File

@@ -1,40 +1,56 @@
name: CI
on:
push:
branches: [master]
branches: [main]
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
branches: [master]
branches: [main]
paths-ignore:
- 'README.md'
- 'docs/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run lint
- run: npm run test
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- uses: actions/upload-artifact@v3
with:
name: action.yml
path: action.yml
test:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
target: [built, committed]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- if: matrix.target == 'built' || github.event_name == 'pull_request'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- if: matrix.target == 'built' || github.event_name == 'pull_request'
uses: actions/download-artifact@v3
with:
name: action.yml
path: .
- name: Test repository dispatch
uses: ./
@@ -50,24 +66,22 @@ jobs:
event-type: tests
package:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update distribution
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: Update distribution
body: |
- Updates the distribution for changes on `master`
- Updates the distribution for changes on `main`
Auto-generated by [create-pull-request][1]

View File

@@ -11,7 +11,7 @@ jobs:
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }}
run: echo "$PAYLOAD_CONTEXT"
- uses: actions/checkout@v2
- uses: actions/checkout@v3
if: github.event.client_payload.ref != ''
with:
ref: ${{ github.event.client_payload.ref }}

View File

@@ -0,0 +1,21 @@
name: Slash Command Dispatch
on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v2
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
config: >
[
{
"command": "rebase",
"permission": "admin",
"repository": "peter-evans/slash-command-dispatch-processor",
"issue_type": "pull-request"
}
]

View File

@@ -1,4 +1,5 @@
# Repository Dispatch
[![CI](https://github.com/peter-evans/repository-dispatch/workflows/CI/badge.svg)](https://github.com/peter-evans/repository-dispatch/actions?query=workflow%3ACI)
[![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Repository%20Dispatch-blue.svg?colorA=24292e&colorB=0366d6&style=flat&longCache=true&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAM6wAADOsB5dZE0gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAERSURBVCiRhZG/SsMxFEZPfsVJ61jbxaF0cRQRcRJ9hlYn30IHN/+9iquDCOIsblIrOjqKgy5aKoJQj4O3EEtbPwhJbr6Te28CmdSKeqzeqr0YbfVIrTBKakvtOl5dtTkK+v4HfA9PEyBFCY9AGVgCBLaBp1jPAyfAJ/AAdIEG0dNAiyP7+K1qIfMdonZic6+WJoBJvQlvuwDqcXadUuqPA1NKAlexbRTAIMvMOCjTbMwl1LtI/6KWJ5Q6rT6Ht1MA58AX8Apcqqt5r2qhrgAXQC3CZ6i1+KMd9TRu3MvA3aH/fFPnBodb6oe6HM8+lYHrGdRXW8M9bMZtPXUji69lmf5Cmamq7quNLFZXD9Rq7v0Bpc1o/tp0fisAAAAASUVORK5CYII=)](https://github.com/marketplace/actions/repository-dispatch)
A GitHub action to create a repository dispatch event.
@@ -7,7 +8,7 @@ A GitHub action to create a repository dispatch event.
```yml
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: my-event
@@ -17,11 +18,17 @@ A GitHub action to create a repository dispatch event.
| 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). | |
| `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) |
| `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. | `{}` |
#### `token`
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://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.
## Example
Here is an example setting all of the input parameters.
@@ -37,7 +44,7 @@ Here is an example setting all of the input parameters.
```
Here is an example `on: repository_dispatch` workflow to receive the event.
Note that repository dispatch events will only trigger a workflow run if the workflow is committed to the default branch (usually `master`).
Note that repository dispatch events will only trigger a workflow run if the workflow is committed to the default branch.
```yml
name: Repository Dispatch
@@ -48,12 +55,36 @@ jobs:
myEvent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
- run: echo ${{ github.event.client_payload.sha }}
```
### Dispatch to multiple 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
jobs:
build:
# Main workflow job that builds, tests, etc.
dispatch:
needs: build
strategy:
matrix:
repo: ['my-org/repo1', 'my-org/repo2', 'my-org/repo3']
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: ${{ matrix.repo }}
event-type: my-event
```
## Client payload
The GitHub API allows a maximum of 10 top-level properties in the `client-payload` JSON.
@@ -76,6 +107,8 @@ The following payload will succeed.
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
[MIT](LICENSE)

View File

@@ -5,7 +5,7 @@ inputs:
description: 'A repo scoped GitHub Personal Access Token'
required: true
repository:
description: 'The full name of the repository to send the dispatch. Defaults to the current repository.'
description: 'The full name of the repository to send the dispatch.'
default: ${{ github.repository }}
event-type:
description: 'A custom webhook event name.'
@@ -14,7 +14,7 @@ inputs:
description: 'JSON payload with extra information about the webhook event that your action or worklow may use.'
default: '{}'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'target'

29254
dist/index.js vendored

File diff suppressed because one or more lines are too long

15127
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
{
"name": "repository-dispatch",
"version": "1.0.0",
"version": "2.0.0",
"private": true,
"description": "Create a repository dispatch event",
"main": "lib/main.js",
"scripts": {
"build": "tsc && ncc build",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"lint": "eslint src/**/*.ts",
"test": "jest --passWithNoTests"
},
@@ -27,22 +27,22 @@
},
"homepage": "https://github.com/peter-evans/repository-dispatch#readme",
"dependencies": {
"@actions/core": "1.2.4",
"@actions/github": "2.1.1"
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0"
},
"devDependencies": {
"@types/jest": "25.2.1",
"@types/node": "13.13.4",
"@typescript-eslint/parser": "2.31.0",
"@zeit/ncc": "0.20.5",
"eslint": "6.8.0",
"eslint-plugin-github": "3.4.1",
"eslint-plugin-jest": "23.9.0",
"jest": "26.0.0",
"jest-circus": "26.0.0",
"js-yaml": "3.13.1",
"prettier": "2.0.5",
"ts-jest": "25.4.0",
"typescript": "3.8.3"
"@types/jest": "^27.0.3",
"@types/node": "^16.11.11",
"@typescript-eslint/parser": "^5.5.0",
"@vercel/ncc": "^0.32.0",
"eslint": "^8.3.0",
"eslint-plugin-github": "^4.3.5",
"eslint-plugin-jest": "^25.3.0",
"jest": "^27.4.3",
"jest-circus": "^27.4.2",
"js-yaml": "^4.1.0",
"prettier": "^2.5.0",
"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
}
}

View File

@@ -1,11 +0,0 @@
{
"extends": [
"config:base"
],
"packageRules": [
{
"depTypeList": ["devDependencies"],
"automerge": true
}
]
}

View File

@@ -14,17 +14,23 @@ async function run(): Promise<void> {
const [owner, repo] = inputs.repository.split('/')
const octokit = new github.GitHub(inputs.token)
const octokit = github.getOctokit(inputs.token)
await octokit.repos.createDispatchEvent({
await octokit.rest.repos.createDispatchEvent({
owner: owner,
repo: repo,
event_type: inputs.eventType,
client_payload: JSON.parse(inputs.clientPayload)
})
} catch (error) {
} catch (error: any) {
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)
}
}
}