mirror of
https://github.com/peter-evans/repository-dispatch.git
synced 2026-06-23 20:55:53 +00:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11ba7d3f32 | ||
|
|
646aa8008a | ||
|
|
8d9724ed37 | ||
|
|
88ec35d633 | ||
|
|
7fbda9c715 | ||
|
|
689b4c9c3d | ||
|
|
ecb27d1931 | ||
|
|
c9a37ac63b | ||
|
|
e006cbaf4a | ||
|
|
12751c0f0e | ||
|
|
3a8608a86b | ||
|
|
f3e2ad4d6d | ||
|
|
28a41e5d3f | ||
|
|
59fb538f54 | ||
|
|
6b9355a6b3 | ||
|
|
0e8ca8c8a5 | ||
|
|
1d7df303a4 | ||
|
|
48ba398488 | ||
|
|
a3b37769d2 | ||
|
|
6c67f6dc34 | ||
|
|
c66206b38f | ||
|
|
5e4869cf56 | ||
|
|
a691d185a6 | ||
|
|
2694ce6b01 | ||
|
|
d7bf02a0d4 | ||
|
|
f43d2e4f9b | ||
|
|
0e60b0b03e | ||
|
|
27c539bc8e | ||
|
|
80935a6f6a | ||
|
|
d410a440ba | ||
|
|
2a643d2b1d | ||
|
|
f7b4de6b26 | ||
|
|
01c34330a7 | ||
|
|
756edddbea | ||
|
|
0ca2845ddc | ||
|
|
a912a66602 | ||
|
|
d57191493a | ||
|
|
47ba5baae1 | ||
|
|
5c418feb53 | ||
|
|
0a654f7a64 | ||
|
|
9570c22b4b | ||
|
|
d8636578df | ||
|
|
6f7481a067 | ||
|
|
83b60ccd45 | ||
|
|
f5abc260cb | ||
|
|
cd5067bcd9 | ||
|
|
c083ba276e | ||
|
|
12a30d3dee | ||
|
|
2960c86134 | ||
|
|
2c97fc16cc | ||
|
|
da8e21ecc8 | ||
|
|
e404a881db | ||
|
|
259edc5079 |
@@ -9,8 +9,7 @@
|
|||||||
"plugin:import/errors",
|
"plugin:import/errors",
|
||||||
"plugin:import/warnings",
|
"plugin:import/warnings",
|
||||||
"plugin:import/typescript",
|
"plugin:import/typescript",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended"
|
||||||
"prettier/@typescript-eslint"
|
|
||||||
],
|
],
|
||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint"],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|||||||
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@@ -1,12 +1,12 @@
|
|||||||
name: CI
|
name: CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
@@ -14,20 +14,20 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 16.x
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm run format-check
|
- run: npm run format-check
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
- run: npm run test
|
- run: npm run test
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: action.yml
|
path: action.yml
|
||||||
@@ -40,14 +40,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: [built, committed]
|
target: [built, committed]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: .
|
path: .
|
||||||
@@ -66,12 +66,12 @@ jobs:
|
|||||||
event-type: tests
|
event-type: tests
|
||||||
|
|
||||||
package:
|
package:
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
commit-message: Update distribution
|
commit-message: Update distribution
|
||||||
title: Update distribution
|
title: Update distribution
|
||||||
body: |
|
body: |
|
||||||
- Updates the distribution for changes on `master`
|
- Updates the distribution for changes on `main`
|
||||||
|
|
||||||
Auto-generated by [create-pull-request][1]
|
Auto-generated by [create-pull-request][1]
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/on-repository-dispatch.yml
vendored
2
.github/workflows/on-repository-dispatch.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }}
|
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }}
|
||||||
run: echo "$PAYLOAD_CONTEXT"
|
run: echo "$PAYLOAD_CONTEXT"
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
if: github.event.client_payload.ref != ''
|
if: github.event.client_payload.ref != ''
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.client_payload.ref }}
|
ref: ${{ github.event.client_payload.ref }}
|
||||||
|
|||||||
31
.github/workflows/update-dep.yml
vendored
31
.github/workflows/update-dep.yml
vendored
@@ -1,31 +0,0 @@
|
|||||||
name: Update Dependencies
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 1 * * 4'
|
|
||||||
jobs:
|
|
||||||
update-dep:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: '12.x'
|
|
||||||
- name: Update dependencies
|
|
||||||
run: |
|
|
||||||
npx -p npm-check-updates ncu -u
|
|
||||||
npm install
|
|
||||||
- name: Create Pull Request
|
|
||||||
uses: peter-evans/create-pull-request@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
|
||||||
commit-message: Update dependencies
|
|
||||||
committer: GitHub <noreply@github.com>
|
|
||||||
author: actions-bot <actions-bot@users.noreply.github.com>
|
|
||||||
title: Update dependencies
|
|
||||||
body: |
|
|
||||||
- Dependency updates
|
|
||||||
|
|
||||||
Auto-generated by [create-pull-request][1]
|
|
||||||
|
|
||||||
[1]: https://github.com/peter-evans/create-pull-request
|
|
||||||
branch: update-dependencies
|
|
||||||
@@ -8,7 +8,7 @@ A GitHub action to create a repository dispatch event.
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||||
event-type: my-event
|
event-type: my-event
|
||||||
@@ -44,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.
|
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
|
```yml
|
||||||
name: Repository Dispatch
|
name: Repository Dispatch
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
myEvent:
|
myEvent:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.client_payload.ref }}
|
ref: ${{ github.event.client_payload.ref }}
|
||||||
- run: echo ${{ github.event.client_payload.sha }}
|
- run: echo ${{ github.event.client_payload.sha }}
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||||
repository: ${{ matrix.repo }}
|
repository: ${{ matrix.repo }}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ inputs:
|
|||||||
description: 'JSON payload with extra information about the webhook event that your action or worklow may use.'
|
description: 'JSON payload with extra information about the webhook event that your action or worklow may use.'
|
||||||
default: '{}'
|
default: '{}'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'target'
|
icon: 'target'
|
||||||
|
|||||||
7102
dist/index.js
vendored
7102
dist/index.js
vendored
File diff suppressed because one or more lines are too long
11595
package-lock.json
generated
11595
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
32
package.json
32
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "repository-dispatch",
|
"name": "repository-dispatch",
|
||||||
"version": "1.0.0",
|
"version": "2.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Create a repository dispatch event",
|
"description": "Create a repository dispatch event",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
@@ -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.6",
|
"@actions/core": "^1.6.0",
|
||||||
"@actions/github": "4.0.0"
|
"@actions/github": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "26.0.15",
|
"@types/jest": "^27.0.3",
|
||||||
"@types/node": "14.14.6",
|
"@types/node": "^16.11.11",
|
||||||
"@typescript-eslint/parser": "4.6.1",
|
"@typescript-eslint/parser": "^5.5.0",
|
||||||
"@vercel/ncc": "0.24.1",
|
"@vercel/ncc": "^0.32.0",
|
||||||
"eslint": "7.12.1",
|
"eslint": "^8.3.0",
|
||||||
"eslint-plugin-github": "4.1.1",
|
"eslint-plugin-github": "^4.3.5",
|
||||||
"eslint-plugin-jest": "24.1.0",
|
"eslint-plugin-jest": "^25.3.0",
|
||||||
"jest": "26.6.3",
|
"jest": "^27.4.3",
|
||||||
"jest-circus": "26.6.3",
|
"jest-circus": "^27.4.2",
|
||||||
"js-yaml": "3.14.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "2.1.2",
|
"prettier": "^2.5.0",
|
||||||
"ts-jest": "26.4.3",
|
"ts-jest": "^27.0.7",
|
||||||
"typescript": "4.0.5"
|
"typescript": "^4.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
const octokit = github.getOctokit(inputs.token)
|
const octokit = github.getOctokit(inputs.token)
|
||||||
|
|
||||||
await octokit.repos.createDispatchEvent({
|
await octokit.rest.repos.createDispatchEvent({
|
||||||
owner: owner,
|
owner: owner,
|
||||||
repo: repo,
|
repo: repo,
|
||||||
event_type: inputs.eventType,
|
event_type: inputs.eventType,
|
||||||
client_payload: JSON.parse(inputs.clientPayload)
|
client_payload: JSON.parse(inputs.clientPayload)
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
core.debug(inspect(error))
|
core.debug(inspect(error))
|
||||||
if (error.status == 404) {
|
if (error.status == 404) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
|
|||||||
Reference in New Issue
Block a user