Compare commits
106 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a45d1fb447 | ||
|
|
3499eb6183 | ||
|
|
3f3b473b8c | ||
|
|
6699836a21 | ||
|
|
c0f553fe54 | ||
|
|
70001242bf | ||
|
|
34aa40e9cf | ||
|
|
641099ddca | ||
|
|
2271f1ddcf | ||
|
|
437c31a11d | ||
|
|
0979079bc2 | ||
|
|
5b751cdf40 | ||
|
|
98357b18bf | ||
|
|
41c0e4b789 | ||
|
|
994332de4c | ||
|
|
22a9089034 | ||
|
|
d4f3be6ce6 | ||
|
|
bc8a47f565 | ||
|
|
a67ef28ca5 | ||
|
|
84ae59a2cd | ||
|
|
b4733b9419 | ||
|
|
0edc001d28 | ||
|
|
430aea0fb1 | ||
|
|
46cdba753c | ||
|
|
b937339b17 | ||
|
|
e9af275c37 | ||
|
|
d3e081a03a | ||
|
|
9ec683ee07 | ||
|
|
65d8d10bf7 | ||
|
|
c96aa2bed1 | ||
|
|
915d841dae | ||
|
|
7713c9d638 | ||
|
|
e51b7d3f74 | ||
|
|
79c231f5da | ||
|
|
18e469570b | ||
|
|
cb4d3bfce1 | ||
|
|
73d0201543 | ||
|
|
ad8fe013b8 | ||
|
|
0514efa437 | ||
|
|
1310d7dab5 | ||
|
|
8ac8226b96 | ||
|
|
10f10de275 | ||
|
|
be92a753c1 | ||
|
|
07cbaebb4b | ||
|
|
2e50522bdf | ||
|
|
6ef886ce85 | ||
|
|
d44cb0467e | ||
|
|
1cef63c140 | ||
|
|
e5a03b409a | ||
|
|
843d83e5bc | ||
|
|
b480b0c440 | ||
|
|
1eca556297 | ||
|
|
56cdd05eb2 | ||
|
|
27d7203bb2 | ||
|
|
111b7d619d | ||
|
|
a59c52d55d | ||
|
|
3319d7b4ff | ||
|
|
c2e8eb39a3 | ||
|
|
1bce17f69c | ||
|
|
0f8b7c5d7e | ||
|
|
0f2a09222f | ||
|
|
cbde760b07 | ||
|
|
88ed63ce14 | ||
|
|
6658b293f0 | ||
|
|
7884c077c7 | ||
|
|
f689536846 | ||
|
|
1f1b618e8e | ||
|
|
889dce9eab | ||
|
|
1e36d60fe9 | ||
|
|
9b309f7eaa | ||
|
|
3b1f4bffdc | ||
|
|
26f1fcb7bd | ||
|
|
799af1ac09 | ||
|
|
450b15d522 | ||
|
|
14576695c2 | ||
|
|
e67dfa71de | ||
|
|
4a56bdc321 | ||
|
|
a7b20e1da2 | ||
|
|
e89bd69e40 | ||
|
|
5bae925c86 | ||
|
|
7a23c9b2d1 | ||
|
|
88d86bdd1a | ||
|
|
5ccebef7df | ||
|
|
7c6dcd5e40 | ||
|
|
b926f73506 | ||
|
|
e468aa4ac9 | ||
|
|
d57e551ebc | ||
|
|
98106d3f2b | ||
|
|
45f0e76ebd | ||
|
|
5aec14b1da | ||
|
|
52bf914c5c | ||
|
|
2fbdcbbbe7 | ||
|
|
e630501767 | ||
|
|
5ddfb02482 | ||
|
|
62822539b5 | ||
|
|
a7759c6f84 | ||
|
|
7b02d9ab89 | ||
|
|
58258f452b | ||
|
|
c16e6f558f | ||
|
|
599a7e63a6 | ||
|
|
271a8d0340 | ||
|
|
6f7efd1c24 | ||
|
|
13c47c5747 | ||
|
|
63e58290d7 | ||
|
|
a92c90fcab | ||
|
|
b23b62d487 |
21 changed files with 3277 additions and 1415 deletions
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
|
|
@ -3,18 +3,27 @@ updates:
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "monthly"
|
||||||
day: "tuesday"
|
day: "tuesday"
|
||||||
labels:
|
labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
|
groups:
|
||||||
|
github-actions:
|
||||||
|
applies-to: version-updates
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "monthly"
|
||||||
day: "tuesday"
|
day: "tuesday"
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-major"]
|
update-types: ["version-update:semver-major"]
|
||||||
labels:
|
labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
|
groups:
|
||||||
|
npm:
|
||||||
|
applies-to: version-updates
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
|
||||||
26
.github/workflows/ci.yml
vendored
26
.github/workflows/ci.yml
vendored
|
|
@ -19,21 +19,21 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version-file: package.json
|
||||||
cache: npm
|
cache: npm
|
||||||
- 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@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: action.yml
|
path: action.yml
|
||||||
|
|
@ -46,16 +46,16 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: [built, committed]
|
target: [built, committed]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v8
|
||||||
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@v4
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: .
|
path: .
|
||||||
|
|
@ -92,7 +92,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v3
|
uses: peter-evans/find-comment@v4
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
|
|
@ -101,7 +101,7 @@ jobs:
|
||||||
|
|
||||||
- if: steps.fc.outputs.comment-id == ''
|
- if: steps.fc.outputs.comment-id == ''
|
||||||
name: Create comment
|
name: Create comment
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
body: |
|
body: |
|
||||||
|
|
@ -118,13 +118,13 @@ jobs:
|
||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
commit-message: 'build: update distribution'
|
commit-message: 'build: update distribution'
|
||||||
|
|
|
||||||
8
.github/workflows/cpr-example-command.yml
vendored
8
.github/workflows/cpr-example-command.yml
vendored
|
|
@ -6,7 +6,7 @@ jobs:
|
||||||
createPullRequest:
|
createPullRequest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Make changes to pull request
|
- name: Make changes to pull request
|
||||||
run: date +%s > report.txt
|
run: date +%s > report.txt
|
||||||
|
|
@ -29,8 +29,8 @@ jobs:
|
||||||
labels: |
|
labels: |
|
||||||
report
|
report
|
||||||
automated pr
|
automated pr
|
||||||
assignees: peter-evans
|
assignees: retepsnave
|
||||||
reviewers: peter-evans
|
reviewers: retepsnave
|
||||||
milestone: 1
|
milestone: 1
|
||||||
draft: false
|
draft: false
|
||||||
branch: example-patches
|
branch: example-patches
|
||||||
|
|
@ -42,7 +42,7 @@ jobs:
|
||||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||||
|
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v4
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
||||||
|
|
|
||||||
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@v4
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
config: >
|
config: >
|
||||||
|
|
|
||||||
4
.github/workflows/update-major-version.yml
vendored
4
.github/workflows/update-major-version.yml
vendored
|
|
@ -11,14 +11,14 @@ on:
|
||||||
type: choice
|
type: choice
|
||||||
description: The major version tag to update
|
description: The major version tag to update
|
||||||
options:
|
options:
|
||||||
- v6
|
|
||||||
- v7
|
- v7
|
||||||
|
- v8
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tag:
|
tag:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
|
||||||
24
README.md
24
README.md
|
|
@ -21,21 +21,21 @@ Create Pull Request action will:
|
||||||
|
|
||||||
- [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
|
- [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
|
||||||
- [Examples](docs/examples.md)
|
- [Examples](docs/examples.md)
|
||||||
- [Updating to v7](docs/updating.md)
|
- [Updating between versions](docs/updating.md)
|
||||||
- [Common issues](docs/common-issues.md)
|
- [Common issues](docs/common-issues.md)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v7.x.x`
|
You can also pin to a [specific release](https://github.com/peter-evans/create-pull-request/releases) version in the format `@v8.x.x`
|
||||||
|
|
||||||
### Workflow permissions
|
### Workflow permissions
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ All inputs are **optional**. If not set, sensible defaults will be used.
|
||||||
| `token` | The token that the action will use to create and update the pull request. See [token](#token). | `GITHUB_TOKEN` |
|
| `token` | The token that the action will use to create and update the pull request. See [token](#token). | `GITHUB_TOKEN` |
|
||||||
| `branch-token` | The token that the action will use to create and update the branch. See [branch-token](#branch-token). | Defaults to the value of `token` |
|
| `branch-token` | The token that the action will use to create and update the branch. See [branch-token](#branch-token). | Defaults to the value of `token` |
|
||||||
| `path` | Relative path under `GITHUB_WORKSPACE` to the repository. | `GITHUB_WORKSPACE` |
|
| `path` | Relative path under `GITHUB_WORKSPACE` to the repository. | `GITHUB_WORKSPACE` |
|
||||||
| `add-paths` | A comma or newline-separated list of file paths to commit. Paths should follow git's [pathspec](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec) syntax. If no paths are specified, all new and modified files are added. See [Add specific paths](#add-specific-paths). | |
|
| `add-paths` | A comma or newline-separated list of file paths to commit. Paths should follow git's [pathspec](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec) syntax. See [Add specific paths](#add-specific-paths). | If no paths are specified, all new and modified files are added. |
|
||||||
| `commit-message` | The message to use when committing changes. See [commit-message](#commit-message). | `[create-pull-request] automated change` |
|
| `commit-message` | The message to use when committing changes. See [commit-message](#commit-message). | `[create-pull-request] automated change` |
|
||||||
| `committer` | The committer name and email address in the format `Display Name <email@address.com>`. Defaults to the GitHub Actions bot user on github.com. | `github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>` |
|
| `committer` | The committer name and email address in the format `Display Name <email@address.com>`. Defaults to the GitHub Actions bot user on github.com. | `github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>` |
|
||||||
| `author` | The author name and email address in the format `Display Name <email@address.com>`. Defaults to the user who triggered the workflow run. | `${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>` |
|
| `author` | The author name and email address in the format `Display Name <email@address.com>`. Defaults to the user who triggered the workflow run. | `${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>` |
|
||||||
|
|
@ -131,7 +131,7 @@ If you want branches to be deleted immediately on merge then you should use GitH
|
||||||
For self-hosted runners behind a corporate proxy set the `https_proxy` environment variable.
|
For self-hosted runners behind a corporate proxy set the `https_proxy` environment variable.
|
||||||
```yml
|
```yml
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
env:
|
env:
|
||||||
https_proxy: http://<proxy_address>:<port>
|
https_proxy: http://<proxy_address>:<port>
|
||||||
```
|
```
|
||||||
|
|
@ -153,7 +153,7 @@ Note that in order to read the step outputs the action step must have an id.
|
||||||
```yml
|
```yml
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
- name: Check outputs
|
- name: Check outputs
|
||||||
if: ${{ steps.cpr.outputs.pull-request-number }}
|
if: ${{ steps.cpr.outputs.pull-request-number }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -216,7 +216,7 @@ File changes that do not match one of the paths will be stashed and restored aft
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
add-paths: |
|
add-paths: |
|
||||||
*.java
|
*.java
|
||||||
|
|
@ -230,7 +230,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Create commits
|
- name: Create commits
|
||||||
run: |
|
run: |
|
||||||
git config user.name 'Peter Evans'
|
git config user.name 'Peter Evans'
|
||||||
|
|
@ -243,7 +243,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
|
||||||
- name: Uncommitted change
|
- name: Uncommitted change
|
||||||
run: date +%s > report.txt
|
run: date +%s > report.txt
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
```
|
```
|
||||||
|
|
||||||
### Auto-merge
|
### Auto-merge
|
||||||
|
|
@ -263,14 +263,14 @@ jobs:
|
||||||
createPullRequest:
|
createPullRequest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Make changes to pull request
|
- name: Make changes to pull request
|
||||||
run: date +%s > report.txt
|
run: date +%s > report.txt
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commit-message: Update report
|
commit-message: Update report
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ outputs:
|
||||||
pull-request-branch:
|
pull-request-branch:
|
||||||
description: 'The pull request branch name'
|
description: 'The pull request branch name'
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'git-pull-request'
|
icon: 'git-pull-request'
|
||||||
|
|
|
||||||
4
dist/790.index.js
vendored
4
dist/790.index.js
vendored
|
|
@ -6,8 +6,8 @@ exports.modules = {
|
||||||
/***/ 790:
|
/***/ 790:
|
||||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||||
|
|
||||||
var N=Object.defineProperty;var c=(_,a)=>N(_,"name",{value:a,configurable:!0});__webpack_require__(3024),__webpack_require__(6760);const node=__webpack_require__(117);__webpack_require__(7067),__webpack_require__(4708),__webpack_require__(8522),__webpack_require__(7075),__webpack_require__(4573),__webpack_require__(7975),__webpack_require__(3465),__webpack_require__(3136),__webpack_require__(7030);let s=0;const S={START_BOUNDARY:s++,HEADER_FIELD_START:s++,HEADER_FIELD:s++,HEADER_VALUE_START:s++,HEADER_VALUE:s++,HEADER_VALUE_ALMOST_DONE:s++,HEADERS_ALMOST_DONE:s++,PART_DATA_START:s++,PART_DATA:s++,END:s++};let f=1;const F={PART_BOUNDARY:f,LAST_BOUNDARY:f*=2},LF=10,CR=13,SPACE=32,HYPHEN=45,COLON=58,A=97,Z=122,lower=c(_=>_|32,"lower"),noop=c(()=>{},"noop");class MultipartParser{static{c(this,"MultipartParser")}constructor(a){this.index=0,this.flags=0,this.onHeaderEnd=noop,this.onHeaderField=noop,this.onHeadersEnd=noop,this.onHeaderValue=noop,this.onPartBegin=noop,this.onPartData=noop,this.onPartEnd=noop,this.boundaryChars={},a=`\r
|
var y=Object.defineProperty;var c=(R,o)=>y(R,"name",{value:o,configurable:!0});const node=__webpack_require__(117);__webpack_require__(7067),__webpack_require__(4708),__webpack_require__(8522),__webpack_require__(7075),__webpack_require__(4573),__webpack_require__(7975),__webpack_require__(3465),__webpack_require__(3136),__webpack_require__(7030),__webpack_require__(3024),__webpack_require__(6760);let s=0;const S={START_BOUNDARY:s++,HEADER_FIELD_START:s++,HEADER_FIELD:s++,HEADER_VALUE_START:s++,HEADER_VALUE:s++,HEADER_VALUE_ALMOST_DONE:s++,HEADERS_ALMOST_DONE:s++,PART_DATA_START:s++,PART_DATA:s++,END:s++};let f=1;const F={PART_BOUNDARY:f,LAST_BOUNDARY:f*=2},LF=10,CR=13,SPACE=32,HYPHEN=45,COLON=58,A=97,Z=122,lower=c(R=>R|32,"lower"),noop=c(()=>{},"noop"),g=class g{constructor(o){this.index=0,this.flags=0,this.onHeaderEnd=noop,this.onHeaderField=noop,this.onHeadersEnd=noop,this.onHeaderValue=noop,this.onPartBegin=noop,this.onPartData=noop,this.onPartEnd=noop,this.boundaryChars={},o=`\r
|
||||||
--`+a;const t=new Uint8Array(a.length);for(let n=0;n<a.length;n++)t[n]=a.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=S.START_BOUNDARY}write(a){let t=0;const n=a.length;let E=this.index,{lookbehind:d,boundary:h,boundaryChars:H,index:e,state:o,flags:l}=this;const b=this.boundary.length,m=b-1,O=a.length;let r,P;const u=c(D=>{this[D+"Mark"]=t},"mark"),i=c(D=>{delete this[D+"Mark"]},"clear"),T=c((D,p,R,g)=>{(p===void 0||p!==R)&&this[D](g&&g.subarray(p,R))},"callback"),L=c((D,p)=>{const R=D+"Mark";R in this&&(p?(T(D,this[R],t,a),delete this[R]):(T(D,this[R],a.length,a),this[R]=0))},"dataCallback");for(t=0;t<n;t++)switch(r=a[t],o){case S.START_BOUNDARY:if(e===h.length-2){if(r===HYPHEN)l|=F.LAST_BOUNDARY;else if(r!==CR)return;e++;break}else if(e-1===h.length-2){if(l&F.LAST_BOUNDARY&&r===HYPHEN)o=S.END,l=0;else if(!(l&F.LAST_BOUNDARY)&&r===LF)e=0,T("onPartBegin"),o=S.HEADER_FIELD_START;else return;break}r!==h[e+2]&&(e=-2),r===h[e+2]&&e++;break;case S.HEADER_FIELD_START:o=S.HEADER_FIELD,u("onHeaderField"),e=0;case S.HEADER_FIELD:if(r===CR){i("onHeaderField"),o=S.HEADERS_ALMOST_DONE;break}if(e++,r===HYPHEN)break;if(r===COLON){if(e===1)return;L("onHeaderField",!0),o=S.HEADER_VALUE_START;break}if(P=lower(r),P<A||P>Z)return;break;case S.HEADER_VALUE_START:if(r===SPACE)break;u("onHeaderValue"),o=S.HEADER_VALUE;case S.HEADER_VALUE:r===CR&&(L("onHeaderValue",!0),T("onHeaderEnd"),o=S.HEADER_VALUE_ALMOST_DONE);break;case S.HEADER_VALUE_ALMOST_DONE:if(r!==LF)return;o=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(r!==LF)return;T("onHeadersEnd"),o=S.PART_DATA_START;break;case S.PART_DATA_START:o=S.PART_DATA,u("onPartData");case S.PART_DATA:if(E=e,e===0){for(t+=m;t<O&&!(a[t]in H);)t+=b;t-=m,r=a[t]}if(e<h.length)h[e]===r?(e===0&&L("onPartData",!0),e++):e=0;else if(e===h.length)e++,r===CR?l|=F.PART_BOUNDARY:r===HYPHEN?l|=F.LAST_BOUNDARY:e=0;else if(e-1===h.length)if(l&F.PART_BOUNDARY){if(e=0,r===LF){l&=~F.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),o=S.HEADER_FIELD_START;break}}else l&F.LAST_BOUNDARY&&r===HYPHEN?(T("onPartEnd"),o=S.END,l=0):e=0;if(e>0)d[e-1]=r;else if(E>0){const D=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);T("onPartData",0,E,D),E=0,u("onPartData"),t--}break;case S.END:break;default:throw new Error(`Unexpected state entered: ${o}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=e,this.state=o,this.flags=l}end(){if(this.state===S.HEADER_FIELD_START&&this.index===0||this.state===S.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==S.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}function _fileName(_){const a=_.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!a)return;const t=a[2]||a[3]||"";let n=t.slice(t.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(E,d)=>String.fromCharCode(d)),n}c(_fileName,"_fileName");async function toFormData(_,a){if(!/multipart/i.test(a))throw new TypeError("Failed to fetch");const t=a.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new TypeError("no or bad content-type header, no multipart boundary");const n=new MultipartParser(t[1]||t[2]);let E,d,h,H,e,o;const l=[],b=new node.FormData,m=c(i=>{h+=u.decode(i,{stream:!0})},"onPartData"),O=c(i=>{l.push(i)},"appendToFile"),r=c(()=>{const i=new node.File(l,o,{type:e});b.append(H,i)},"appendFileToFormData"),P=c(()=>{b.append(H,h)},"appendEntryToFormData"),u=new TextDecoder("utf-8");u.decode(),n.onPartBegin=function(){n.onPartData=m,n.onPartEnd=P,E="",d="",h="",H="",e="",o=null,l.length=0},n.onHeaderField=function(i){E+=u.decode(i,{stream:!0})},n.onHeaderValue=function(i){d+=u.decode(i,{stream:!0})},n.onHeaderEnd=function(){if(d+=u.decode(),E=E.toLowerCase(),E==="content-disposition"){const i=d.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);i&&(H=i[2]||i[3]||""),o=_fileName(d),o&&(n.onPartData=O,n.onPartEnd=r)}else E==="content-type"&&(e=d);d="",E=""};for await(const i of _)n.write(i);return n.end(),b}c(toFormData,"toFormData"),exports.toFormData=toFormData;
|
--`+o;const t=new Uint8Array(o.length);for(let n=0;n<o.length;n++)t[n]=o.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=S.START_BOUNDARY}write(o){let t=0;const n=o.length;let E=this.index,{lookbehind:l,boundary:h,boundaryChars:H,index:e,state:a,flags:d}=this;const b=this.boundary.length,m=b-1,O=o.length;let r,P;const u=c(D=>{this[D+"Mark"]=t},"mark"),i=c(D=>{delete this[D+"Mark"]},"clear"),T=c((D,p,_,N)=>{(p===void 0||p!==_)&&this[D](N&&N.subarray(p,_))},"callback"),L=c((D,p)=>{const _=D+"Mark";_ in this&&(p?(T(D,this[_],t,o),delete this[_]):(T(D,this[_],o.length,o),this[_]=0))},"dataCallback");for(t=0;t<n;t++)switch(r=o[t],a){case S.START_BOUNDARY:if(e===h.length-2){if(r===HYPHEN)d|=F.LAST_BOUNDARY;else if(r!==CR)return;e++;break}else if(e-1===h.length-2){if(d&F.LAST_BOUNDARY&&r===HYPHEN)a=S.END,d=0;else if(!(d&F.LAST_BOUNDARY)&&r===LF)e=0,T("onPartBegin"),a=S.HEADER_FIELD_START;else return;break}r!==h[e+2]&&(e=-2),r===h[e+2]&&e++;break;case S.HEADER_FIELD_START:a=S.HEADER_FIELD,u("onHeaderField"),e=0;case S.HEADER_FIELD:if(r===CR){i("onHeaderField"),a=S.HEADERS_ALMOST_DONE;break}if(e++,r===HYPHEN)break;if(r===COLON){if(e===1)return;L("onHeaderField",!0),a=S.HEADER_VALUE_START;break}if(P=lower(r),P<A||P>Z)return;break;case S.HEADER_VALUE_START:if(r===SPACE)break;u("onHeaderValue"),a=S.HEADER_VALUE;case S.HEADER_VALUE:r===CR&&(L("onHeaderValue",!0),T("onHeaderEnd"),a=S.HEADER_VALUE_ALMOST_DONE);break;case S.HEADER_VALUE_ALMOST_DONE:if(r!==LF)return;a=S.HEADER_FIELD_START;break;case S.HEADERS_ALMOST_DONE:if(r!==LF)return;T("onHeadersEnd"),a=S.PART_DATA_START;break;case S.PART_DATA_START:a=S.PART_DATA,u("onPartData");case S.PART_DATA:if(E=e,e===0){for(t+=m;t<O&&!(o[t]in H);)t+=b;t-=m,r=o[t]}if(e<h.length)h[e]===r?(e===0&&L("onPartData",!0),e++):e=0;else if(e===h.length)e++,r===CR?d|=F.PART_BOUNDARY:r===HYPHEN?d|=F.LAST_BOUNDARY:e=0;else if(e-1===h.length)if(d&F.PART_BOUNDARY){if(e=0,r===LF){d&=~F.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),a=S.HEADER_FIELD_START;break}}else d&F.LAST_BOUNDARY&&r===HYPHEN?(T("onPartEnd"),a=S.END,d=0):e=0;if(e>0)l[e-1]=r;else if(E>0){const D=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);T("onPartData",0,E,D),E=0,u("onPartData"),t--}break;case S.END:break;default:throw new Error(`Unexpected state entered: ${a}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=e,this.state=a,this.flags=d}end(){if(this.state===S.HEADER_FIELD_START&&this.index===0||this.state===S.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==S.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};c(g,"MultipartParser");let MultipartParser=g;function _fileName(R){const o=R.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!o)return;const t=o[2]||o[3]||"";let n=t.slice(t.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(E,l)=>String.fromCharCode(l)),n}c(_fileName,"_fileName");async function toFormData(R,o){if(!/multipart/i.test(o))throw new TypeError("Failed to fetch");const t=o.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!t)throw new TypeError("no or bad content-type header, no multipart boundary");const n=new MultipartParser(t[1]||t[2]);let E,l,h,H,e,a;const d=[],b=new node.FormData,m=c(i=>{h+=u.decode(i,{stream:!0})},"onPartData"),O=c(i=>{d.push(i)},"appendToFile"),r=c(()=>{const i=new node.File(d,a,{type:e});b.append(H,i)},"appendFileToFormData"),P=c(()=>{b.append(H,h)},"appendEntryToFormData"),u=new TextDecoder("utf-8");u.decode(),n.onPartBegin=function(){n.onPartData=m,n.onPartEnd=P,E="",l="",h="",H="",e="",a=null,d.length=0},n.onHeaderField=function(i){E+=u.decode(i,{stream:!0})},n.onHeaderValue=function(i){l+=u.decode(i,{stream:!0})},n.onHeaderEnd=function(){if(l+=u.decode(),E=E.toLowerCase(),E==="content-disposition"){const i=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);i&&(H=i[2]||i[3]||""),a=_fileName(l),a&&(n.onPartData=O,n.onPartEnd=r)}else E==="content-type"&&(e=l);l="",E=""};for await(const i of R)n.write(i);return n.end(),b}c(toFormData,"toFormData"),exports.toFormData=toFormData;
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
|
||||||
932
dist/index.js
vendored
932
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -37,7 +37,7 @@ So the straightforward solution is to just not install them during the workflow
|
||||||
|
|
||||||
- If hooks are automatically enabled by a framework, use an option provided by the framework to disable them. For example, for Husky users, they can be disabled with the `--ignore-scripts` flag, or by setting the `HUSKY` environment variable when the action runs.
|
- If hooks are automatically enabled by a framework, use an option provided by the framework to disable them. For example, for Husky users, they can be disabled with the `--ignore-scripts` flag, or by setting the `HUSKY` environment variable when the action runs.
|
||||||
```yml
|
```yml
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
env:
|
env:
|
||||||
HUSKY: '0'
|
HUSKY: '0'
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ This document covers terminology, how the action works, general usage guidelines
|
||||||
|
|
||||||
## Terminology
|
## Terminology
|
||||||
|
|
||||||
[Pull requests](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#about-pull-requests) are proposed changes to a repository branch that can be reviewed by a repository's collaborators before being accepted or rejected.
|
[Pull requests](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#about-pull-requests) are proposed changes to a repository branch that can be reviewed by a repository's collaborators before being accepted or rejected.
|
||||||
|
|
||||||
A pull request references two branches:
|
A pull request references two branches:
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ For each [event type](https://docs.github.com/en/actions/reference/events-that-t
|
||||||
The default can be overridden by specifying a `ref` on checkout.
|
The default can be overridden by specifying a `ref` on checkout.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: develop
|
ref: develop
|
||||||
```
|
```
|
||||||
|
|
@ -77,7 +77,7 @@ jobs:
|
||||||
example:
|
example:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
```
|
```
|
||||||
|
|
||||||
There may be use cases where it makes sense to execute the workflow on a branch that is not the base of the pull request. In these cases, the base branch can be specified with the `base` action input. The action will attempt to rebase changes made during the workflow on to the actual base.
|
There may be use cases where it makes sense to execute the workflow on a branch that is not the base of the pull request. In these cases, the base branch can be specified with the `base` action input. The action will attempt to rebase changes made during the workflow on to the actual base.
|
||||||
|
|
@ -92,7 +92,7 @@ In these cases, you *must supply* the `base` input so the action can rebase chan
|
||||||
Workflows triggered by [`pull_request`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request) events will by default check out a merge commit. Set the `base` input as follows to base the new pull request on the current pull request's branch.
|
Workflows triggered by [`pull_request`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request) events will by default check out a merge commit. Set the `base` input as follows to base the new pull request on the current pull request's branch.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: peter-evans/create-pull-request@v7
|
- uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
base: ${{ github.head_ref }}
|
base: ${{ github.head_ref }}
|
||||||
```
|
```
|
||||||
|
|
@ -100,7 +100,7 @@ Workflows triggered by [`pull_request`](https://docs.github.com/en/actions/refer
|
||||||
Workflows triggered by [`release`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release) events will by default check out a tag. For most use cases, you will need to set the `base` input to the branch name of the tagged commit.
|
Workflows triggered by [`release`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release) events will by default check out a tag. For most use cases, you will need to set the `base` input to the branch name of the tagged commit.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: peter-evans/create-pull-request@v7
|
- uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
base: main
|
base: main
|
||||||
```
|
```
|
||||||
|
|
@ -150,7 +150,7 @@ There are a number of workarounds with different pros and cons.
|
||||||
|
|
||||||
- Use the default `GITHUB_TOKEN` and allow the action to create pull requests that have no checks enabled. Manually close pull requests and immediately reopen them. This will enable `on: pull_request` workflows to run and be added as checks. To prevent merging of pull requests without checks erroneously, use [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests).
|
- Use the default `GITHUB_TOKEN` and allow the action to create pull requests that have no checks enabled. Manually close pull requests and immediately reopen them. This will enable `on: pull_request` workflows to run and be added as checks. To prevent merging of pull requests without checks erroneously, use [branch protection rules](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests).
|
||||||
|
|
||||||
- Create draft pull requests by setting the `draft: always-true` input, and configure your workflow to trigger `on: ready_for_review`. The workflow will run when users manually click the "Ready for review" button on the draft pull requests. If the pull request is updated by the action, the `always-true` mode ensures that the pull request will be converted back to a draft.
|
- Create draft pull requests by setting the `draft: always-true` input, and configure your workflow to trigger `ready_for_review` in `on: pull_request`. The workflow will run when users manually click the "Ready for review" button on the draft pull requests. If the pull request is updated by the action, the `always-true` mode ensures that the pull request will be converted back to a draft.
|
||||||
|
|
||||||
- Use a [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) created on an account that has write access to the repository that pull requests are being created in. This is the standard workaround and [recommended by GitHub](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow). It's advisable to use a dedicated [machine account](https://docs.github.com/en/github/site-policy/github-terms-of-service#3-account-requirements) that has collaborator access to the repository, rather than creating a PAT on a personal user account. Also note that because the account that owns the PAT will be the creator of pull requests, that user account will be unable to perform actions such as request changes or approve the pull request.
|
- Use a [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) created on an account that has write access to the repository that pull requests are being created in. This is the standard workaround and [recommended by GitHub](https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow). It's advisable to use a dedicated [machine account](https://docs.github.com/en/github/site-policy/github-terms-of-service#3-account-requirements) that has collaborator access to the repository, rather than creating a PAT on a personal user account. Also note that because the account that owns the PAT will be the creator of pull requests, that user account will be unable to perform actions such as request changes or approve the pull request.
|
||||||
|
|
||||||
|
|
@ -179,14 +179,14 @@ This action uses [ncc](https://github.com/vercel/ncc) to compile the Node.js cod
|
||||||
Checking out a branch from a different repository from where the workflow is executing will make *that repository* the target for the created pull request. In this case, the `GITHUB_TOKEN` will not work and one of the other [token options](../README.md#token) must be used.
|
Checking out a branch from a different repository from where the workflow is executing will make *that repository* the target for the created pull request. In this case, the `GITHUB_TOKEN` will not work and one of the other [token options](../README.md#token) must be used.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
repository: owner/repo
|
repository: owner/repo
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- uses: peter-evans/create-pull-request@v7
|
- uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
```
|
```
|
||||||
|
|
@ -197,8 +197,9 @@ Checking out a branch from a different repository from where the workflow is exe
|
||||||
Allowing the action to push with a configured deploy key will trigger `on: push` workflows. This makes it an alternative to using a PAT to trigger checks for pull requests.
|
Allowing the action to push with a configured deploy key will trigger `on: push` workflows. This makes it an alternative to using a PAT to trigger checks for pull requests.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> You cannot use deploy keys alone to [create a pull request in a remote repository](#creating-pull-requests-in-a-remote-repository) because then using a PAT would become a requirement.
|
> - You cannot use deploy keys alone to [create a pull request in a remote repository](#creating-pull-requests-in-a-remote-repository) because then using a PAT would become a requirement.
|
||||||
> This method only makes sense if creating a pull request in the repository where the workflow is running.
|
> This method only makes sense if creating a pull request in the repository where the workflow is running.
|
||||||
|
> - You cannot use deploy keys with [commit signature verification for bots](#commit-signature-verification-for-bots) (`sign-commits: true`).
|
||||||
|
|
||||||
How to use SSH (deploy keys) with create-pull-request action:
|
How to use SSH (deploy keys) with create-pull-request action:
|
||||||
|
|
||||||
|
|
@ -209,14 +210,14 @@ How to use SSH (deploy keys) with create-pull-request action:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
```
|
```
|
||||||
|
|
||||||
### Push pull request branches to a fork
|
### Push pull request branches to a fork
|
||||||
|
|
@ -237,11 +238,11 @@ It will use their own fork to push code and create the pull request.
|
||||||
6. As shown in the following example workflow, set the `push-to-fork` input to the full repository name of the fork.
|
6. As shown in the following example workflow, set the `push-to-fork` input to the full repository name of the fork.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- uses: peter-evans/create-pull-request@v7
|
- uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.MACHINE_USER_PAT }}
|
token: ${{ secrets.MACHINE_USER_PAT }}
|
||||||
push-to-fork: machine-user/fork-of-repository
|
push-to-fork: machine-user/fork-of-repository
|
||||||
|
|
@ -271,7 +272,7 @@ The `token` input will then default to the repository's `GITHUB_TOKEN`, which wi
|
||||||
|
|
||||||
The following is an example of pushing to a fork using GitHub App tokens.
|
The following is an example of pushing to a fork using GitHub App tokens.
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v2
|
||||||
id: generate-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.APP_ID }}
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
|
@ -279,12 +280,12 @@ The following is an example of pushing to a fork using GitHub App tokens.
|
||||||
owner: owner
|
owner: owner
|
||||||
repositories: fork-of-repo
|
repositories: fork-of-repo
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
branch-token: ${{ steps.generate-token.outputs.token }}
|
branch-token: ${{ steps.generate-token.outputs.token }}
|
||||||
push-to-fork: owner/fork-of-repo
|
push-to-fork: owner/fork-of-repo
|
||||||
|
|
@ -318,18 +319,18 @@ GitHub App generated tokens can be configured with fine-grained permissions and
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v2
|
||||||
id: generate-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.APP_ID }}
|
app-id: ${{ secrets.APP_ID }}
|
||||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
```
|
```
|
||||||
|
|
@ -341,7 +342,7 @@ For this case a token must be generated from the GitHub App installation of the
|
||||||
In the following example, a pull request is being created in remote repo `owner/repo`.
|
In the following example, a pull request is being created in remote repo `owner/repo`.
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v2
|
||||||
id: generate-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.APP_ID }}
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
|
@ -349,7 +350,7 @@ In the following example, a pull request is being created in remote repo `owner/
|
||||||
owner: owner
|
owner: owner
|
||||||
repositories: repo
|
repositories: repo
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }} # necessary if the repo is private
|
token: ${{ steps.generate-token.outputs.token }} # necessary if the repo is private
|
||||||
repository: owner/repo
|
repository: owner/repo
|
||||||
|
|
@ -357,7 +358,7 @@ In the following example, a pull request is being created in remote repo `owner/
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
```
|
```
|
||||||
|
|
@ -373,7 +374,7 @@ The action supports two methods to sign commits, [commit signature verification
|
||||||
|
|
||||||
The action can sign commits as `github-actions[bot]` when using the repository's default `GITHUB_TOKEN`, or your own bot when using [GitHub App tokens](#authenticating-with-github-app-generated-tokens).
|
The action can sign commits as `github-actions[bot]` when using the repository's default `GITHUB_TOKEN`, or your own bot when using [GitHub App tokens](#authenticating-with-github-app-generated-tokens).
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> - When setting `sign-commits: true` the action will ignore the `committer` and `author` inputs.
|
> - When setting `sign-commits: true` the action will ignore the `committer` and `author` inputs.
|
||||||
> - If you attempt to use a [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) the action will create the pull request, but commits will *not* be signed. Commit signing is only supported with bot generated tokens.
|
> - If you attempt to use a [Personal Access Token (PAT)](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) the action will create the pull request, but commits will *not* be signed. Commit signing is only supported with bot generated tokens.
|
||||||
> - The GitHub API has a 40MiB limit when creating git blobs. An error will be raised if there are files in the pull request larger than this. If you hit this limit, use [GPG commit signature verification](#gpg-commit-signature-verification) instead.
|
> - The GitHub API has a 40MiB limit when creating git blobs. An error will be raised if there are files in the pull request larger than this. If you hit this limit, use [GPG commit signature verification](#gpg-commit-signature-verification) instead.
|
||||||
|
|
@ -381,12 +382,12 @@ The action can sign commits as `github-actions[bot]` when using the repository's
|
||||||
In this example the `token` input is not supplied, so the action will use the repository's default `GITHUB_TOKEN`. This will sign commits as `github-actions[bot]`.
|
In this example the `token` input is not supplied, so the action will use the repository's default `GITHUB_TOKEN`. This will sign commits as `github-actions[bot]`.
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
sign-commits: true
|
sign-commits: true
|
||||||
```
|
```
|
||||||
|
|
@ -394,9 +395,9 @@ In this example the `token` input is not supplied, so the action will use the re
|
||||||
In this example, the `token` input is generated using a GitHub App. This will sign commits as `<application-name>[bot]`.
|
In this example, the `token` input is generated using a GitHub App. This will sign commits as `<application-name>[bot]`.
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions/create-github-app-token@v1
|
- uses: actions/create-github-app-token@v2
|
||||||
id: generate-token
|
id: generate-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.APP_ID }}
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
|
@ -405,7 +406,7 @@ In this example, the `token` input is generated using a GitHub App. This will si
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate-token.outputs.token }}
|
token: ${{ steps.generate-token.outputs.token }}
|
||||||
sign-commits: true
|
sign-commits: true
|
||||||
|
|
@ -436,7 +437,7 @@ The action can use GPG to sign commits with a GPG key that you generate yourself
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: crazy-max/ghaction-import-gpg@v5
|
- uses: crazy-max/ghaction-import-gpg@v5
|
||||||
with:
|
with:
|
||||||
|
|
@ -448,7 +449,7 @@ The action can use GPG to sign commits with a GPG key that you generate yourself
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
committer: example <email@example.com>
|
committer: example <email@example.com>
|
||||||
|
|
@ -473,12 +474,12 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: apk --no-cache add git
|
run: apk --no-cache add git
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
```
|
```
|
||||||
|
|
||||||
**Ubuntu container example:**
|
**Ubuntu container example:**
|
||||||
|
|
@ -496,10 +497,10 @@ jobs:
|
||||||
add-apt-repository -y ppa:git-core/ppa
|
add-apt-repository -y ppa:git-core/ppa
|
||||||
apt-get install -y git
|
apt-get install -y git
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Make changes to pull request here
|
# Make changes to pull request here
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,14 @@ jobs:
|
||||||
updateAuthors:
|
updateAuthors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Update AUTHORS
|
- name: Update AUTHORS
|
||||||
run: |
|
run: |
|
||||||
git log --format='%aN <%aE>%n%cN <%cE>' | sort -u > AUTHORS
|
git log --format='%aN <%aE>%n%cN <%cE>' | sort -u > AUTHORS
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
commit-message: update authors
|
commit-message: update authors
|
||||||
title: Update AUTHORS
|
title: Update AUTHORS
|
||||||
|
|
@ -73,7 +73,7 @@ jobs:
|
||||||
productionPromotion:
|
productionPromotion:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: production
|
ref: production
|
||||||
- name: Reset promotion branch
|
- name: Reset promotion branch
|
||||||
|
|
@ -81,7 +81,7 @@ jobs:
|
||||||
git fetch origin main:main
|
git fetch origin main:main
|
||||||
git reset --hard main
|
git reset --hard main
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
branch: production-promotion
|
branch: production-promotion
|
||||||
```
|
```
|
||||||
|
|
@ -106,7 +106,7 @@ jobs:
|
||||||
updateChangelog:
|
updateChangelog:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Update Changelog
|
- name: Update Changelog
|
||||||
|
|
@ -116,7 +116,7 @@ jobs:
|
||||||
./git-chglog -o CHANGELOG.md
|
./git-chglog -o CHANGELOG.md
|
||||||
rm git-chglog
|
rm git-chglog
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
commit-message: update changelog
|
commit-message: update changelog
|
||||||
title: Update Changelog
|
title: Update Changelog
|
||||||
|
|
@ -144,7 +144,7 @@ jobs:
|
||||||
update-dep:
|
update-dep:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
|
|
@ -153,7 +153,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@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commit-message: Update dependencies
|
commit-message: Update dependencies
|
||||||
|
|
@ -180,7 +180,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
|
|
@ -204,7 +204,7 @@ jobs:
|
||||||
update-dep:
|
update-dep:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-java@v2
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
@ -214,7 +214,7 @@ jobs:
|
||||||
- name: Perform dependency resolution and write new lockfiles
|
- name: Perform dependency resolution and write new lockfiles
|
||||||
run: ./gradlew dependencies --write-locks
|
run: ./gradlew dependencies --write-locks
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commit-message: Update dependencies
|
commit-message: Update dependencies
|
||||||
|
|
@ -242,14 +242,14 @@ jobs:
|
||||||
update-dep:
|
update-dep:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Update dependencies
|
- name: Update dependencies
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo-edit
|
cargo install cargo-edit
|
||||||
cargo update
|
cargo update
|
||||||
cargo upgrade --to-lockfile
|
cargo upgrade --to-lockfile
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
commit-message: Update dependencies
|
commit-message: Update dependencies
|
||||||
|
|
@ -277,7 +277,7 @@ jobs:
|
||||||
updateSwagger:
|
updateSwagger:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Get Latest Swagger UI Release
|
- name: Get Latest Swagger UI Release
|
||||||
id: swagger-ui
|
id: swagger-ui
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -307,7 +307,7 @@ jobs:
|
||||||
# Update current release
|
# Update current release
|
||||||
echo ${{ steps.swagger-ui.outputs.release_tag }} > swagger-ui.version
|
echo ${{ steps.swagger-ui.outputs.release_tag }} > swagger-ui.version
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
commit-message: Update swagger-ui to ${{ steps.swagger-ui.outputs.release_tag }}
|
commit-message: Update swagger-ui to ${{ steps.swagger-ui.outputs.release_tag }}
|
||||||
title: Update SwaggerUI to ${{ steps.swagger-ui.outputs.release_tag }}
|
title: Update SwaggerUI to ${{ steps.swagger-ui.outputs.release_tag }}
|
||||||
|
|
@ -342,7 +342,7 @@ jobs:
|
||||||
updateFork:
|
updateFork:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
repository: fork-owner/repo
|
repository: fork-owner/repo
|
||||||
- name: Reset the default branch with upstream changes
|
- name: Reset the default branch with upstream changes
|
||||||
|
|
@ -351,7 +351,7 @@ jobs:
|
||||||
git fetch upstream main:upstream-main
|
git fetch upstream main:upstream-main
|
||||||
git reset --hard upstream-main
|
git reset --hard upstream-main
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
branch: upstream-changes
|
branch: upstream-changes
|
||||||
|
|
@ -370,7 +370,7 @@ jobs:
|
||||||
format:
|
format:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- name: Download website
|
- name: Download website
|
||||||
run: |
|
run: |
|
||||||
wget \
|
wget \
|
||||||
|
|
@ -384,7 +384,7 @@ jobs:
|
||||||
--domains quotes.toscrape.com \
|
--domains quotes.toscrape.com \
|
||||||
http://quotes.toscrape.com/
|
http://quotes.toscrape.com/
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
commit-message: update local website copy
|
commit-message: update local website copy
|
||||||
title: Automated Updates to Local Website Copy
|
title: Automated Updates to Local Website Copy
|
||||||
|
|
@ -466,7 +466,7 @@ jobs:
|
||||||
if: startsWith(github.head_ref, 'autopep8-patches') == false && github.event.pull_request.head.repo.full_name == github.repository
|
if: startsWith(github.head_ref, 'autopep8-patches') == false && github.event.pull_request.head.repo.full_name == github.repository
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
- name: autopep8
|
- name: autopep8
|
||||||
|
|
@ -481,7 +481,7 @@ jobs:
|
||||||
echo "branch-name=$branch-name" >> $GITHUB_OUTPUT
|
echo "branch-name=$branch-name" >> $GITHUB_OUTPUT
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
if: steps.autopep8.outputs.exit-code == 2
|
if: steps.autopep8.outputs.exit-code == 2
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
commit-message: autopep8 action fixes
|
commit-message: autopep8 action fixes
|
||||||
title: Fixes by autopep8 action
|
title: Fixes by autopep8 action
|
||||||
|
|
@ -515,13 +515,13 @@ jobs:
|
||||||
if: startsWith(github.ref, 'refs/heads/')
|
if: startsWith(github.ref, 'refs/heads/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
...
|
...
|
||||||
|
|
||||||
someOtherJob:
|
someOtherJob:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -540,7 +540,7 @@ Note that the step where output variables are defined must have an id.
|
||||||
echo "pr_title=$pr_title" >> $GITHUB_OUTPUT
|
echo "pr_title=$pr_title" >> $GITHUB_OUTPUT
|
||||||
echo "pr_body=$pr_body" >> $GITHUB_OUTPUT
|
echo "pr_body=$pr_body" >> $GITHUB_OUTPUT
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
title: ${{ steps.vars.outputs.pr_title }}
|
title: ${{ steps.vars.outputs.pr_title }}
|
||||||
body: ${{ steps.vars.outputs.pr_body }}
|
body: ${{ steps.vars.outputs.pr_body }}
|
||||||
|
|
@ -566,7 +566,7 @@ The template is rendered using the [render-template](https://github.com/chuhlomi
|
||||||
bar: that
|
bar: that
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
body: ${{ steps.template.outputs.result }}
|
body: ${{ steps.template.outputs.result }}
|
||||||
```
|
```
|
||||||
|
|
@ -622,7 +622,7 @@ For example:
|
||||||
```yml
|
```yml
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v8
|
||||||
|
|
||||||
- name: Show message for created Pull Request
|
- name: Show message for created Pull Request
|
||||||
if: ${{ steps.cpr.outputs.pull-request-url && steps.cpr.outputs.pull-request-operation != 'none' }}
|
if: ${{ steps.cpr.outputs.pull-request-url && steps.cpr.outputs.pull-request-operation != 'none' }}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,14 @@
|
||||||
|
## Updating from `v7` to `v8`
|
||||||
|
|
||||||
|
### Behaviour changes
|
||||||
|
|
||||||
|
- If using self-hosted runners or GitHub Enterprise Server, there are minimum requirements for `v8` to run. See "What's new" below for details.
|
||||||
|
|
||||||
|
### What's new
|
||||||
|
|
||||||
|
- Updated runtime to Node.js 24
|
||||||
|
- The action now requires a minimum version of [v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) for the Actions runner. Update self-hosted runners to v2.327.1 or later to ensure compatibility.
|
||||||
|
|
||||||
## Updating from `v6` to `v7`
|
## Updating from `v6` to `v7`
|
||||||
|
|
||||||
### Behaviour changes
|
### Behaviour changes
|
||||||
|
|
|
||||||
3288
package-lock.json
generated
3288
package-lock.json
generated
File diff suppressed because it is too large
Load diff
38
package.json
38
package.json
|
|
@ -1,9 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "create-pull-request",
|
"name": "create-pull-request",
|
||||||
"version": "7.0.0",
|
"version": "8.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Creates a pull request for changes to your repository in the actions workspace",
|
"description": "Creates a pull request for changes to your repository in the actions workspace",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.4.0"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && ncc build",
|
"build": "tsc && ncc build",
|
||||||
"format": "prettier --write '**/*.ts'",
|
"format": "prettier --write '**/*.ts'",
|
||||||
|
|
@ -31,33 +34,34 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@octokit/core": "^6.1.4",
|
"@octokit/core": "^6.1.6",
|
||||||
"@octokit/plugin-paginate-rest": "^11.4.2",
|
"@octokit/plugin-paginate-rest": "^11.6.0",
|
||||||
"@octokit/plugin-rest-endpoint-methods": "^13.3.1",
|
"@octokit/plugin-rest-endpoint-methods": "^13.5.0",
|
||||||
"@octokit/plugin-throttling": "^9.4.0",
|
"@octokit/plugin-retry": "^7.2.1",
|
||||||
"node-fetch-native": "^1.6.6",
|
"@octokit/plugin-throttling": "^9.6.1",
|
||||||
|
"node-fetch-native": "^1.6.7",
|
||||||
"p-limit": "^6.2.0",
|
"p-limit": "^6.2.0",
|
||||||
"uuid": "^9.0.1"
|
"uuid": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "^18.19.76",
|
"@types/node": "^18.19.130",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@typescript-eslint/parser": "^7.18.0",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.4",
|
||||||
"eslint": "^8.57.1",
|
"eslint": "^8.57.1",
|
||||||
"eslint-import-resolver-typescript": "^3.8.1",
|
"eslint-import-resolver-typescript": "^3.10.1",
|
||||||
"eslint-plugin-github": "^4.10.2",
|
"eslint-plugin-github": "^4.10.2",
|
||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.32.0",
|
||||||
"eslint-plugin-jest": "^27.9.0",
|
"eslint-plugin-jest": "^27.9.0",
|
||||||
"eslint-plugin-prettier": "^5.2.3",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-circus": "^29.7.0",
|
"jest-circus": "^29.7.0",
|
||||||
"jest-environment-jsdom": "^29.7.0",
|
"jest-environment-jsdom": "^30.2.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.1",
|
||||||
"prettier": "^3.5.1",
|
"prettier": "^3.8.1",
|
||||||
"ts-jest": "^29.2.5",
|
"ts-jest": "^29.4.6",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.9.3",
|
||||||
"undici": "^6.21.1"
|
"undici": "^6.23.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -121,12 +121,20 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
||||||
`The 'base' and 'branch' for a pull request must be different branches. Unable to continue.`
|
`The 'base' and 'branch' for a pull request must be different branches. Unable to continue.`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// For self-hosted runners the repository state persists between runs.
|
if (utils.isSelfHosted()) {
|
||||||
// This command prunes the stale remote ref when the pull request branch was
|
// For self-hosted runners the repository state persists between runs.
|
||||||
// deleted after being merged or closed. Without this the push using
|
// This command prunes the stale remote ref when the pull request branch was
|
||||||
// '--force-with-lease' fails due to "stale info."
|
// deleted after being merged or closed. Without this the push using
|
||||||
// https://github.com/peter-evans/create-pull-request/issues/633
|
// '--force-with-lease' fails due to "stale info."
|
||||||
await git.exec(['remote', 'prune', branchRemoteName])
|
// https://github.com/peter-evans/create-pull-request/issues/633
|
||||||
|
try {
|
||||||
|
await git.exec(['remote', 'prune', branchRemoteName])
|
||||||
|
} catch (error) {
|
||||||
|
core.warning(
|
||||||
|
`Failed to prune remote '${branchRemoteName}': ${(error as Error).message}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
// Apply the branch suffix if set
|
// Apply the branch suffix if set
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import * as exec from '@actions/exec'
|
||||||
import * as io from '@actions/io'
|
import * as io from '@actions/io'
|
||||||
import * as utils from './utils'
|
import * as utils from './utils'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
import stream, {Writable} from 'stream'
|
||||||
|
|
||||||
const tagsRefSpec = '+refs/tags/*:refs/tags/*'
|
const tagsRefSpec = '+refs/tags/*:refs/tags/*'
|
||||||
|
|
||||||
|
|
@ -24,6 +25,7 @@ export type Commit = {
|
||||||
export type ExecOpts = {
|
export type ExecOpts = {
|
||||||
allowAllExitCodes?: boolean
|
allowAllExitCodes?: boolean
|
||||||
encoding?: 'utf8' | 'base64'
|
encoding?: 'utf8' | 'base64'
|
||||||
|
suppressGitCmdOutput?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GitCommandManager {
|
export class GitCommandManager {
|
||||||
|
|
@ -161,17 +163,20 @@ export class GitCommandManager {
|
||||||
|
|
||||||
async getCommit(ref: string): Promise<Commit> {
|
async getCommit(ref: string): Promise<Commit> {
|
||||||
const endOfBody = '###EOB###'
|
const endOfBody = '###EOB###'
|
||||||
const output = await this.exec([
|
const output = await this.exec(
|
||||||
'-c',
|
[
|
||||||
'core.quotePath=false',
|
'-c',
|
||||||
'show',
|
'core.quotePath=false',
|
||||||
'--raw',
|
'show',
|
||||||
'--cc',
|
'--raw',
|
||||||
'--no-renames',
|
'--cc',
|
||||||
'--no-abbrev',
|
'--no-renames',
|
||||||
`--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
|
'--no-abbrev',
|
||||||
ref
|
`--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
|
||||||
])
|
ref
|
||||||
|
],
|
||||||
|
{suppressGitCmdOutput: true}
|
||||||
|
)
|
||||||
const lines = output.stdout.split('\n')
|
const lines = output.stdout.split('\n')
|
||||||
const endOfBodyIndex = lines.lastIndexOf(endOfBody)
|
const endOfBodyIndex = lines.lastIndexOf(endOfBody)
|
||||||
const detailLines = lines.slice(0, endOfBodyIndex)
|
const detailLines = lines.slice(0, endOfBodyIndex)
|
||||||
|
|
@ -285,7 +290,10 @@ export class GitCommandManager {
|
||||||
|
|
||||||
async showFileAtRefBase64(ref: string, path: string): Promise<string> {
|
async showFileAtRefBase64(ref: string, path: string): Promise<string> {
|
||||||
const args = ['show', `${ref}:${path}`]
|
const args = ['show', `${ref}:${path}`]
|
||||||
const output = await this.exec(args, {encoding: 'base64'})
|
const output = await this.exec(args, {
|
||||||
|
encoding: 'base64',
|
||||||
|
suppressGitCmdOutput: true
|
||||||
|
})
|
||||||
return output.stdout.trim()
|
return output.stdout.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,10 +370,19 @@ export class GitCommandManager {
|
||||||
|
|
||||||
async exec(
|
async exec(
|
||||||
args: string[],
|
args: string[],
|
||||||
{encoding = 'utf8', allowAllExitCodes = false}: ExecOpts = {}
|
{
|
||||||
|
encoding = 'utf8',
|
||||||
|
allowAllExitCodes = false,
|
||||||
|
suppressGitCmdOutput = false
|
||||||
|
}: ExecOpts = {}
|
||||||
): Promise<GitOutput> {
|
): Promise<GitOutput> {
|
||||||
const result = new GitOutput()
|
const result = new GitOutput()
|
||||||
|
|
||||||
|
if (process.env['CPR_SHOW_GIT_CMD_OUTPUT']) {
|
||||||
|
// debug mode overrides the suppressGitCmdOutput option
|
||||||
|
suppressGitCmdOutput = false
|
||||||
|
}
|
||||||
|
|
||||||
const env = {}
|
const env = {}
|
||||||
for (const key of Object.keys(process.env)) {
|
for (const key of Object.keys(process.env)) {
|
||||||
env[key] = process.env[key]
|
env[key] = process.env[key]
|
||||||
|
|
@ -389,7 +406,9 @@ export class GitCommandManager {
|
||||||
stderr.push(data)
|
stderr.push(data)
|
||||||
stderrLength += data.length
|
stderrLength += data.length
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
outStream: outStreamHandler(process.stdout, suppressGitCmdOutput),
|
||||||
|
errStream: outStreamHandler(process.stderr, suppressGitCmdOutput)
|
||||||
}
|
}
|
||||||
|
|
||||||
result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options)
|
result.exitCode = await exec.exec(`"${this.gitPath}"`, args, options)
|
||||||
|
|
@ -404,3 +423,24 @@ class GitOutput {
|
||||||
stderr = ''
|
stderr = ''
|
||||||
exitCode = 0
|
exitCode = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const outStreamHandler = (
|
||||||
|
outStream: Writable,
|
||||||
|
suppressGitCmdOutput: boolean
|
||||||
|
): Writable => {
|
||||||
|
return new stream.Writable({
|
||||||
|
write(chunk, _, next) {
|
||||||
|
if (suppressGitCmdOutput) {
|
||||||
|
const lines = chunk.toString().trimEnd().split('\n')
|
||||||
|
for (const line of lines) {
|
||||||
|
if (line.startsWith('[command]')) {
|
||||||
|
outStream.write(`${line}\n`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
outStream.write(chunk)
|
||||||
|
}
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ export class GitConfigHelper {
|
||||||
private extraheaderConfigPlaceholderValue = 'AUTHORIZATION: basic ***'
|
private extraheaderConfigPlaceholderValue = 'AUTHORIZATION: basic ***'
|
||||||
private extraheaderConfigValueRegex = '^AUTHORIZATION:'
|
private extraheaderConfigValueRegex = '^AUTHORIZATION:'
|
||||||
private persistedExtraheaderConfigValue = ''
|
private persistedExtraheaderConfigValue = ''
|
||||||
|
private backedUpCredentialFiles: string[] = []
|
||||||
|
|
||||||
private constructor(git: GitCommandManager) {
|
private constructor(git: GitCommandManager) {
|
||||||
this.git = git
|
this.git = git
|
||||||
|
|
@ -121,11 +122,15 @@ export class GitConfigHelper {
|
||||||
async savePersistedAuth(): Promise<void> {
|
async savePersistedAuth(): Promise<void> {
|
||||||
const serverUrl = new URL(`https://${this.getGitRemote().hostname}`)
|
const serverUrl = new URL(`https://${this.getGitRemote().hostname}`)
|
||||||
this.extraheaderConfigKey = `http.${serverUrl.origin}/.extraheader`
|
this.extraheaderConfigKey = `http.${serverUrl.origin}/.extraheader`
|
||||||
|
// Backup checkout@v6 credential files if they exist
|
||||||
|
await this.hideCredentialFiles()
|
||||||
// Save and unset persisted extraheader credential in git config if it exists
|
// Save and unset persisted extraheader credential in git config if it exists
|
||||||
this.persistedExtraheaderConfigValue = await this.getAndUnset()
|
this.persistedExtraheaderConfigValue = await this.getAndUnset()
|
||||||
}
|
}
|
||||||
|
|
||||||
async restorePersistedAuth(): Promise<void> {
|
async restorePersistedAuth(): Promise<void> {
|
||||||
|
// Restore checkout@v6 credential files if they were backed up
|
||||||
|
await this.unhideCredentialFiles()
|
||||||
if (this.persistedExtraheaderConfigValue) {
|
if (this.persistedExtraheaderConfigValue) {
|
||||||
try {
|
try {
|
||||||
await this.setExtraheaderConfig(this.persistedExtraheaderConfigValue)
|
await this.setExtraheaderConfig(this.persistedExtraheaderConfigValue)
|
||||||
|
|
@ -169,6 +174,51 @@ export class GitConfigHelper {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async hideCredentialFiles(): Promise<void> {
|
||||||
|
// Temporarily hide checkout@v6 credential files to avoid duplicate auth headers
|
||||||
|
const runnerTemp = process.env['RUNNER_TEMP']
|
||||||
|
if (!runnerTemp) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const files = await fs.promises.readdir(runnerTemp)
|
||||||
|
for (const file of files) {
|
||||||
|
if (file.startsWith('git-credentials-') && file.endsWith('.config')) {
|
||||||
|
const sourcePath = path.join(runnerTemp, file)
|
||||||
|
const backupPath = `${sourcePath}.bak`
|
||||||
|
await fs.promises.rename(sourcePath, backupPath)
|
||||||
|
this.backedUpCredentialFiles.push(backupPath)
|
||||||
|
core.info(
|
||||||
|
`Temporarily hiding checkout credential file: ${file} (will be restored after)`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// If directory doesn't exist or we can't read it, just continue
|
||||||
|
core.debug(
|
||||||
|
`Could not backup credential files: ${utils.getErrorMessage(e)}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async unhideCredentialFiles(): Promise<void> {
|
||||||
|
// Restore checkout@v6 credential files that were backed up
|
||||||
|
for (const backupPath of this.backedUpCredentialFiles) {
|
||||||
|
try {
|
||||||
|
const originalPath = backupPath.replace(/\.bak$/, '')
|
||||||
|
await fs.promises.rename(backupPath, originalPath)
|
||||||
|
const fileName = path.basename(originalPath)
|
||||||
|
core.info(`Restored checkout credential file: ${fileName}`)
|
||||||
|
} catch (e) {
|
||||||
|
core.warning(
|
||||||
|
`Failed to restore credential file ${backupPath}: ${utils.getErrorMessage(e)}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.backedUpCredentialFiles = []
|
||||||
|
}
|
||||||
|
|
||||||
private async getAndUnset(): Promise<string> {
|
private async getAndUnset(): Promise<string> {
|
||||||
let configValue = ''
|
let configValue = ''
|
||||||
// Save and unset persisted extraheader credential in git config if it exists
|
// Save and unset persisted extraheader credential in git config if it exists
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {Inputs} from './create-pull-request'
|
import {Inputs} from './create-pull-request'
|
||||||
import {Commit, GitCommandManager} from './git-command-manager'
|
import {Commit, GitCommandManager} from './git-command-manager'
|
||||||
import {Octokit, OctokitOptions, throttleOptions} from './octokit-client'
|
import {
|
||||||
|
Octokit,
|
||||||
|
OctokitOptions,
|
||||||
|
retryOptions,
|
||||||
|
throttleOptions
|
||||||
|
} from './octokit-client'
|
||||||
import pLimit from 'p-limit'
|
import pLimit from 'p-limit'
|
||||||
import * as utils from './utils'
|
import * as utils from './utils'
|
||||||
|
|
||||||
|
|
@ -52,6 +57,7 @@ export class GitHubHelper {
|
||||||
options.baseUrl = 'https://api.github.com'
|
options.baseUrl = 'https://api.github.com'
|
||||||
}
|
}
|
||||||
options.throttle = throttleOptions
|
options.throttle = throttleOptions
|
||||||
|
options.retry = retryOptions
|
||||||
this.octokit = new Octokit(options)
|
this.octokit = new Octokit(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,6 +69,50 @@ export class GitHubHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async getPullNumber(
|
||||||
|
baseRepository: string,
|
||||||
|
headBranch: string,
|
||||||
|
baseBranch: string
|
||||||
|
): Promise<number> {
|
||||||
|
const {data: pulls} = await this.octokit.rest.pulls.list({
|
||||||
|
...this.parseRepository(baseRepository),
|
||||||
|
state: 'open',
|
||||||
|
head: headBranch,
|
||||||
|
base: baseBranch
|
||||||
|
})
|
||||||
|
let pullNumber: number | undefined = undefined
|
||||||
|
if (pulls?.length === 0 || pulls === null || pulls === undefined) {
|
||||||
|
// This is a fallback due to a bug that affects the list endpoint when called on forks with the same owner as the repository parent.
|
||||||
|
core.info(
|
||||||
|
`Pull request not found via list endpoint; attempting fallback mechanism`
|
||||||
|
)
|
||||||
|
for await (const response of this.octokit.paginate.iterator(
|
||||||
|
this.octokit.rest.pulls.list,
|
||||||
|
{
|
||||||
|
...this.parseRepository(baseRepository),
|
||||||
|
state: 'open',
|
||||||
|
base: baseBranch
|
||||||
|
}
|
||||||
|
)) {
|
||||||
|
const existingPull = response.data.find(
|
||||||
|
pull => pull.head.label === headBranch
|
||||||
|
)
|
||||||
|
if (existingPull !== undefined) {
|
||||||
|
pullNumber = existingPull.number
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pullNumber = pulls[0].number
|
||||||
|
}
|
||||||
|
if (pullNumber === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
`Failed to find pull request number for branch ${headBranch}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return pullNumber
|
||||||
|
}
|
||||||
|
|
||||||
private async createOrUpdate(
|
private async createOrUpdate(
|
||||||
inputs: Inputs,
|
inputs: Inputs,
|
||||||
baseRepository: string,
|
baseRepository: string,
|
||||||
|
|
@ -113,16 +163,15 @@ export class GitHubHelper {
|
||||||
|
|
||||||
// Update the pull request that exists for this branch and base
|
// Update the pull request that exists for this branch and base
|
||||||
core.info(`Fetching existing pull request`)
|
core.info(`Fetching existing pull request`)
|
||||||
const {data: pulls} = await this.octokit.rest.pulls.list({
|
const pullNumber = await this.getPullNumber(
|
||||||
...this.parseRepository(baseRepository),
|
baseRepository,
|
||||||
state: 'open',
|
headBranch,
|
||||||
head: headBranch,
|
inputs.base
|
||||||
base: inputs.base
|
)
|
||||||
})
|
|
||||||
core.info(`Attempting update of pull request`)
|
core.info(`Attempting update of pull request`)
|
||||||
const {data: pull} = await this.octokit.rest.pulls.update({
|
const {data: pull} = await this.octokit.rest.pulls.update({
|
||||||
...this.parseRepository(baseRepository),
|
...this.parseRepository(baseRepository),
|
||||||
pull_number: pulls[0].number,
|
pull_number: pullNumber,
|
||||||
title: inputs.title,
|
title: inputs.title,
|
||||||
body: inputs.body
|
body: inputs.body
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import * as core from '@actions/core'
|
||||||
import {Octokit as OctokitCore} from '@octokit/core'
|
import {Octokit as OctokitCore} from '@octokit/core'
|
||||||
import {paginateRest} from '@octokit/plugin-paginate-rest'
|
import {paginateRest} from '@octokit/plugin-paginate-rest'
|
||||||
import {restEndpointMethods} from '@octokit/plugin-rest-endpoint-methods'
|
import {restEndpointMethods} from '@octokit/plugin-rest-endpoint-methods'
|
||||||
|
import {retry} from '@octokit/plugin-retry'
|
||||||
import {throttling} from '@octokit/plugin-throttling'
|
import {throttling} from '@octokit/plugin-throttling'
|
||||||
import {fetch} from 'node-fetch-native/proxy'
|
import {fetch} from 'node-fetch-native/proxy'
|
||||||
export {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods'
|
export {RestEndpointMethodTypes} from '@octokit/plugin-rest-endpoint-methods'
|
||||||
|
|
@ -11,6 +12,7 @@ export {OctokitOptions} from '@octokit/core/dist-types/types'
|
||||||
export const Octokit = OctokitCore.plugin(
|
export const Octokit = OctokitCore.plugin(
|
||||||
paginateRest,
|
paginateRest,
|
||||||
restEndpointMethods,
|
restEndpointMethods,
|
||||||
|
retry,
|
||||||
throttling,
|
throttling,
|
||||||
autoProxyAgent
|
autoProxyAgent
|
||||||
)
|
)
|
||||||
|
|
@ -32,6 +34,11 @@ export const throttleOptions = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const retryOptions = {
|
||||||
|
// 429 is handled by the throttling plugin, so we exclude it from retry
|
||||||
|
doNotRetry: [400, 401, 403, 404, 410, 422, 429, 451]
|
||||||
|
}
|
||||||
|
|
||||||
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
|
// Octokit plugin to support the standard environment variables http_proxy, https_proxy and no_proxy
|
||||||
function autoProxyAgent(octokit: OctokitCore) {
|
function autoProxyAgent(octokit: OctokitCore) {
|
||||||
octokit.hook.before('request', options => {
|
octokit.hook.before('request', options => {
|
||||||
|
|
|
||||||
|
|
@ -135,3 +135,8 @@ export function getErrorMessage(error: unknown) {
|
||||||
if (error instanceof Error) return error.message
|
if (error instanceof Error) return error.message
|
||||||
return String(error)
|
return String(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const isSelfHosted = (): boolean =>
|
||||||
|
process.env['RUNNER_ENVIRONMENT'] !== 'github-hosted' &&
|
||||||
|
(process.env['AGENT_ISSELFHOSTED'] === '1' ||
|
||||||
|
process.env['AGENT_ISSELFHOSTED'] === undefined)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue