mirror of
https://github.com/peter-evans/repository-dispatch.git
synced 2026-06-11 19:31:26 +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/warnings",
|
||||
"plugin:import/typescript",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier/@typescript-eslint"
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"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
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'docs/**'
|
||||
pull_request:
|
||||
branches: [master]
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'docs/**'
|
||||
@@ -14,20 +14,20 @@ 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@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: action.yml
|
||||
path: action.yml
|
||||
@@ -40,14 +40,14 @@ jobs:
|
||||
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@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: action.yml
|
||||
path: .
|
||||
@@ -66,12 +66,12 @@ 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
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
commit-message: Update distribution
|
||||
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]
|
||||
|
||||
|
||||
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) }}
|
||||
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 }}
|
||||
|
||||
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
|
||||
- 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
|
||||
@@ -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.
|
||||
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
|
||||
@@ -55,7 +55,7 @@ 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 }}
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||
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.'
|
||||
default: '{}'
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
branding:
|
||||
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",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.0",
|
||||
"private": true,
|
||||
"description": "Create a repository dispatch event",
|
||||
"main": "lib/main.js",
|
||||
@@ -27,22 +27,22 @@
|
||||
},
|
||||
"homepage": "https://github.com/peter-evans/repository-dispatch#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "1.2.6",
|
||||
"@actions/github": "4.0.0"
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/github": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "26.0.15",
|
||||
"@types/node": "14.14.6",
|
||||
"@typescript-eslint/parser": "4.6.1",
|
||||
"@vercel/ncc": "0.24.1",
|
||||
"eslint": "7.12.1",
|
||||
"eslint-plugin-github": "4.1.1",
|
||||
"eslint-plugin-jest": "24.1.0",
|
||||
"jest": "26.6.3",
|
||||
"jest-circus": "26.6.3",
|
||||
"js-yaml": "3.14.0",
|
||||
"prettier": "2.1.2",
|
||||
"ts-jest": "26.4.3",
|
||||
"typescript": "4.0.5"
|
||||
"@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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ async function run(): Promise<void> {
|
||||
|
||||
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))
|
||||
if (error.status == 404) {
|
||||
core.setFailed(
|
||||
|
||||
Reference in New Issue
Block a user