mirror of
https://github.com/peter-evans/repository-dispatch.git
synced 2026-06-15 05:11:25 +00:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff45666b94 | ||
|
|
a4a90276d0 | ||
|
|
2605253283 | ||
|
|
ab3258eeef | ||
|
|
240bc73193 | ||
|
|
8aa15c54a0 | ||
|
|
22aa07cf23 | ||
|
|
ba0298574b | ||
|
|
accfd7b5bf | ||
|
|
3c7d964ae9 | ||
|
|
a59ba977c3 | ||
|
|
c3b7524243 | ||
|
|
5f670ea8b7 | ||
|
|
bcfbaeb74e | ||
|
|
d79089c9c9 | ||
|
|
b27c2a4f3d | ||
|
|
028c6747db | ||
|
|
87bc57c26c | ||
|
|
a78afe5d4d | ||
|
|
2d0bdfc6b9 | ||
|
|
a6471e86a6 | ||
|
|
b248105557 | ||
|
|
4c39f040fc | ||
|
|
98b1133981 | ||
|
|
216b20dc13 | ||
|
|
5ae56f8c81 | ||
|
|
736d2012d3 | ||
|
|
0035c1aba5 | ||
|
|
9fc02fe745 | ||
|
|
b41a2cb1d9 | ||
|
|
0fd5c8a50c | ||
|
|
00088f604a | ||
|
|
b8f36a36a2 | ||
|
|
9357a1ed46 | ||
|
|
3aaf3c98b5 | ||
|
|
dcee2abba5 | ||
|
|
5cfe78c11f | ||
|
|
bddd584cd5 | ||
|
|
c83d47bf36 | ||
|
|
076a6583ce | ||
|
|
7b2061d7b8 | ||
|
|
a6fe98fcaf | ||
|
|
fccec4a11f | ||
|
|
8b03bd17a9 | ||
|
|
495ea77d5f |
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -19,20 +19,20 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 20.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@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: action.yml
|
path: action.yml
|
||||||
@@ -45,14 +45,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: [built, committed]
|
target: [built, committed]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v4
|
||||||
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@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: .
|
path: .
|
||||||
@@ -73,8 +73,8 @@ jobs:
|
|||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
|
|||||||
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@v3
|
- uses: actions/checkout@v4
|
||||||
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-major-version.yml
vendored
Normal file
31
.github/workflows/update-major-version.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Update Major Version
|
||||||
|
run-name: Update ${{ github.event.inputs.main_version }} to ${{ github.event.inputs.target }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
description: The target tag or reference
|
||||||
|
required: true
|
||||||
|
main_version:
|
||||||
|
type: choice
|
||||||
|
description: The major version tag to update
|
||||||
|
options:
|
||||||
|
- v3
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Git config
|
||||||
|
run: |
|
||||||
|
git config user.name actions-bot
|
||||||
|
git config user.email actions-bot@users.noreply.github.com
|
||||||
|
- name: Tag new target
|
||||||
|
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }}
|
||||||
|
- name: Push new tag
|
||||||
|
run: git push origin ${{ github.event.inputs.main_version }} --force
|
||||||
34
README.md
34
README.md
@@ -9,7 +9,7 @@ A GitHub action to create a repository dispatch event.
|
|||||||
Dispatch an event to the current repository.
|
Dispatch an event to the current repository.
|
||||||
```yml
|
```yml
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v2
|
uses: peter-evans/repository-dispatch@v3
|
||||||
with:
|
with:
|
||||||
event-type: my-event
|
event-type: my-event
|
||||||
```
|
```
|
||||||
@@ -17,7 +17,7 @@ Dispatch an event to the current repository.
|
|||||||
Dispatch an event to a remote repository using a `repo` scoped [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
|
Dispatch an event to a remote repository using a `repo` scoped [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
|
||||||
```yml
|
```yml
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v2
|
uses: peter-evans/repository-dispatch@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: username/my-repo
|
repository: username/my-repo
|
||||||
@@ -51,7 +51,7 @@ Here is an example setting all of the input parameters.
|
|||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v2
|
uses: peter-evans/repository-dispatch@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: username/my-repo
|
repository: username/my-repo
|
||||||
@@ -94,7 +94,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Repository Dispatch
|
- name: Repository Dispatch
|
||||||
uses: peter-evans/repository-dispatch@v2
|
uses: peter-evans/repository-dispatch@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: ${{ matrix.repo }}
|
repository: ${{ matrix.repo }}
|
||||||
@@ -125,6 +125,32 @@ 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.
|
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.
|
||||||
|
|
||||||
|
### Multiline
|
||||||
|
|
||||||
|
A multiline `client-payload` can be set directly in YAML, as in the following example.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
- name: Repository Dispatch
|
||||||
|
uses: peter-evans/repository-dispatch@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.PAT }}
|
||||||
|
repository: username/my-repo
|
||||||
|
event-type: my-event
|
||||||
|
client-payload: |-
|
||||||
|
{
|
||||||
|
"repo": {
|
||||||
|
"name": "${{ github.repository }}",
|
||||||
|
"branch": "${{ needs.build_cfg.outputs.REPO_BRANCH }}",
|
||||||
|
"tag": "${{ needs.build_cfg.outputs.REPO_TAG }}"
|
||||||
|
},
|
||||||
|
"deployment": {
|
||||||
|
"project": "${{ env.MY_PROJECT }}",
|
||||||
|
"container": "${{ env.MY_CONTAINER }}",
|
||||||
|
"deploy_msg": "${{ env.SLACK_DEPLOY_MSG }}",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT](LICENSE)
|
[MIT](LICENSE)
|
||||||
|
|||||||
@@ -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: 'node16'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'target'
|
icon: 'target'
|
||||||
|
|||||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -643,7 +643,7 @@ class OidcClient {
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
throw new Error(`Failed to get ID Token. \n
|
throw new Error(`Failed to get ID Token. \n
|
||||||
Error Code : ${error.statusCode}\n
|
Error Code : ${error.statusCode}\n
|
||||||
Error Message: ${error.result.message}`);
|
Error Message: ${error.message}`);
|
||||||
});
|
});
|
||||||
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
|
||||||
if (!id_token) {
|
if (!id_token) {
|
||||||
|
|||||||
2115
package-lock.json
generated
2115
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "repository-dispatch",
|
"name": "repository-dispatch",
|
||||||
"version": "2.0.0",
|
"version": "3.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,21 +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.10.0",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/github": "^5.1.1"
|
"@actions/github": "^5.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.0.3",
|
"@types/jest": "^27.0.3",
|
||||||
"@types/node": "^18.17.12",
|
"@types/node": "^18.19.8",
|
||||||
"@typescript-eslint/parser": "^5.62.0",
|
"@typescript-eslint/parser": "^5.62.0",
|
||||||
"@vercel/ncc": "^0.36.1",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-plugin-github": "^4.9.0",
|
"eslint-plugin-github": "^4.10.1",
|
||||||
"eslint-plugin-jest": "^25.7.0",
|
"eslint-plugin-jest": "^25.7.0",
|
||||||
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"jest": "^27.5.1",
|
"jest": "^27.5.1",
|
||||||
"jest-circus": "^29.6.4",
|
"jest-circus": "^29.7.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.2.4",
|
||||||
"ts-jest": "^27.1.5",
|
"ts-jest": "^27.1.5",
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user