Compare commits

..

66 Commits

Author SHA1 Message Date
a0f85c82ff fix edge case where changes are partially merged 2024-08-28 17:36:51 +01:00
ce190a9972 update readme about the permissions of the default token 2024-08-27 21:20:52 +01:00
9fc91d93e9 update docs 2024-08-27 21:20:51 +01:00
6c4c6cfe81 multipart tree creation 2024-08-27 21:20:51 +01:00
633a5a9752 use parent tree for base_tree 2024-08-27 21:20:51 +01:00
02efff68da use parent commit details in create commit 2024-08-27 21:20:51 +01:00
034fcb0bf3 pass base commit to push signed commits 2024-08-27 21:20:51 +01:00
42beb85339 parse empty commits 2024-08-27 21:20:51 +01:00
a3546365cd catch errors during blob creation for debugging 2024-08-27 21:20:51 +01:00
1e681e3226 update docs with blob size limit 2024-08-27 21:20:51 +01:00
8f92797560 convert to draft on branch updates when there is a diff with base 2024-08-27 21:20:50 +01:00
c64379e4f4 draft always-true 2024-08-27 21:20:50 +01:00
10454726b6 fix verified output when no commit signing is being used 2024-08-27 21:20:50 +01:00
1cd6df66ac check verification status of head commit when not known 2024-08-27 21:20:50 +01:00
32e97fc746 build branch commits when there is a diff with the base 2024-08-27 21:20:50 +01:00
2ba41ede85 update docs 2024-08-27 21:20:50 +01:00
942e5a917e fix doc 2024-08-27 21:20:50 +01:00
981b4699e5 update docs 2024-08-27 21:20:50 +01:00
4a0f9a8513 remove deprecated env output 2024-08-27 21:20:50 +01:00
c006a630f0 fix branch token input 2024-08-27 21:20:49 +01:00
1985abb7f4 rename git-token to branch-token 2024-08-27 21:20:49 +01:00
5294a5ed9d add maintainer-can-modify input 2024-08-27 21:20:49 +01:00
b793f780d4 use separate client for branch and pull operations 2024-08-27 21:20:49 +01:00
f5bdca7bbf output retryafter for secondary rate limit 2024-08-27 21:20:49 +01:00
59815b27ea default the operation output to none 2024-08-27 21:20:49 +01:00
eb6967ba69 fix head sha output 2024-08-27 21:20:49 +01:00
1fbc61676c log outputs 2024-08-27 21:20:48 +01:00
139c557742 output head sha and verified status 2024-08-27 21:20:48 +01:00
e572f56030 set default back to false 2024-08-27 21:20:48 +01:00
13fa7b0c66 add throttling 2024-08-27 21:20:48 +01:00
3cc54e847d update docs 2024-08-27 21:20:48 +01:00
0a565da02b fix capital letter 2024-08-27 21:20:48 +01:00
cc836600d9 update docs for commit signing 2024-08-27 21:20:48 +01:00
b7277ab0b4 update readme link 2024-08-27 21:20:48 +01:00
72cf0929ae remove unused code 2024-08-27 21:20:48 +01:00
53ed82a297 only build commits when feature enabled 2024-08-27 21:20:48 +01:00
3a6bc1b6c6 limit blob creation concurrency 2024-08-27 21:20:47 +01:00
219a33fe88 add executable mode file to test 2024-08-27 21:20:47 +01:00
384bd7f976 fix format and cleanup 2024-08-27 21:20:47 +01:00
4c77294175 debug commit verification 2024-08-27 21:20:47 +01:00
d94a826899 debug commit verification 2024-08-27 21:20:47 +01:00
0785201fba try fix base tree 2024-08-27 21:20:47 +01:00
63aac9338f force push 2024-08-27 21:20:47 +01:00
8605c43792 fix check for branch existence 2024-08-27 21:20:46 +01:00
0c8901cc91 try rest api route 2024-08-27 21:20:46 +01:00
6b1053d0d8 use source mode for deleted files 2024-08-27 21:20:46 +01:00
b2a409b0a3 build branch commits 2024-08-27 21:20:46 +01:00
ec02db74e9 fix format 2024-08-27 21:20:46 +01:00
029414bc07 add function to get commit detail 2024-08-27 21:20:46 +01:00
9cd16daf06 build file changes even when there is no diff 2024-08-27 21:20:46 +01:00
6c5dc224d1 refactor graphql code into github helper class 2024-08-27 21:20:45 +01:00
9c7a97affd add build file changes test for binary files 2024-08-27 21:20:45 +01:00
c29821586c add tests for building file changes 2024-08-27 21:20:45 +01:00
9d7ad21b2f Try refactor of file changes 2024-08-27 21:20:45 +01:00
f09d6ed256 remove commented code 2024-08-27 21:20:45 +01:00
d88643b9ac try to fix head repo 2024-08-27 21:20:45 +01:00
184d576617 fix filepath when using path input 2024-08-27 21:20:45 +01:00
396429353a disable linter for debug code 2024-08-27 21:20:44 +01:00
efd26f0872 debug payload without contents 2024-08-27 21:20:44 +01:00
bc73bc700a read to buffer not string and use non-legacy method to base64 2024-08-27 21:20:44 +01:00
8f257d093e add debug lines 2024-08-27 21:20:44 +01:00
7ccbe5d7c3 sign commits by default for testing 2024-08-27 21:20:44 +01:00
014f5c1fb1 shift setting the base to before the push 2024-08-27 21:20:44 +01:00
4cf9647c0e fix eslint and lint errors 2024-08-27 21:20:44 +01:00
8a55f622b6 formatting 2024-08-27 21:20:16 +01:00
744c8ceb5d Add support for signed commits (#3055) 2024-08-27 21:20:15 +01:00
7 changed files with 37 additions and 53 deletions

View File

@ -32,10 +32,10 @@ Create Pull Request action will:
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
```
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 `@v6.x.x`
### Workflow permissions
@ -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.
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
env:
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
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
@ -216,7 +216,7 @@ File changes that do not match one of the paths will be stashed and restored aft
```yml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
add-paths: |
*.java
@ -243,7 +243,7 @@ Note that the repository must be checked out on a branch with a remote, it won't
- name: Uncommitted change
run: date +%s > report.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
```
### Create a project card
@ -253,7 +253,7 @@ To create a project card for the pull request, pass the `pull-request-number` st
```yml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
- name: Create or Update Project Card
if: ${{ steps.cpr.outputs.pull-request-number }}
@ -288,7 +288,7 @@ jobs:
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
commit-message: Update report

View File

@ -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.
```yml
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
env:
HUSKY: '0'
```

View File

@ -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.
```yml
- uses: peter-evans/create-pull-request@v7
- uses: peter-evans/create-pull-request@v6
with:
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.
```yml
- uses: peter-evans/create-pull-request@v7
- uses: peter-evans/create-pull-request@v6
with:
base: main
```
@ -186,7 +186,7 @@ Checking out a branch from a different repository from where the workflow is exe
# Make changes to pull request here
- uses: peter-evans/create-pull-request@v7
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
```
@ -216,7 +216,7 @@ How to use SSH (deploy keys) with create-pull-request action:
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
```
### Push pull request branches to a fork
@ -241,7 +241,7 @@ It will use their own fork to push code and create the pull request.
# Make changes to pull request here
- uses: peter-evans/create-pull-request@v7
- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.MACHINE_USER_PAT }}
push-to-fork: machine-user/fork-of-repository
@ -284,7 +284,7 @@ The following is an example of pushing to a fork using GitHub App tokens.
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
branch-token: ${{ steps.generate-token.outputs.token }}
push-to-fork: owner/fork-of-repo
@ -329,7 +329,7 @@ GitHub App generated tokens can be configured with fine-grained permissions and
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
```
@ -357,7 +357,7 @@ In the following example, a pull request is being created in remote repo `owner/
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
```
@ -386,7 +386,7 @@ In this example the `token` input is not supplied, so the action will use the re
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
sign-commits: true
```
@ -405,7 +405,7 @@ In this example, the `token` input is generated using a GitHub App. This will si
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
sign-commits: true
@ -448,7 +448,7 @@ The action can use GPG to sign commits with a GPG key that you generate yourself
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
committer: example <email@example.com>
@ -478,7 +478,7 @@ jobs:
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
```
**Ubuntu container example:**
@ -501,5 +501,5 @@ jobs:
# Make changes to pull request here
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
```

View File

@ -49,7 +49,7 @@ jobs:
run: |
git log --format='%aN <%aE>%n%cN <%cE>' | sort -u > AUTHORS
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
commit-message: update authors
title: Update AUTHORS
@ -81,7 +81,7 @@ jobs:
git fetch origin main:main
git reset --hard main
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
branch: production-promotion
```
@ -116,7 +116,7 @@ jobs:
./git-chglog -o CHANGELOG.md
rm git-chglog
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
commit-message: update changelog
title: Update Changelog
@ -153,7 +153,7 @@ jobs:
npx -p npm-check-updates ncu -u
npm install
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
commit-message: Update dependencies
@ -214,7 +214,7 @@ jobs:
- name: Perform dependency resolution and write new lockfiles
run: ./gradlew dependencies --write-locks
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
commit-message: Update dependencies
@ -249,7 +249,7 @@ jobs:
cargo update
cargo upgrade --to-lockfile
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
commit-message: Update dependencies
@ -307,7 +307,7 @@ jobs:
# Update current release
echo ${{ steps.swagger-ui.outputs.release_tag }} > swagger-ui.version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update swagger-ui to ${{ steps.swagger-ui.outputs.release_tag }}
title: Update SwaggerUI to ${{ steps.swagger-ui.outputs.release_tag }}
@ -351,7 +351,7 @@ jobs:
git fetch upstream main:upstream-main
git reset --hard upstream-main
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT }}
branch: upstream-changes
@ -384,7 +384,7 @@ jobs:
--domains quotes.toscrape.com \
http://quotes.toscrape.com/
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
commit-message: update local website copy
title: Automated Updates to Local Website Copy
@ -481,7 +481,7 @@ jobs:
echo "branch-name=$branch-name" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.autopep8.outputs.exit-code == 2
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
commit-message: autopep8 action fixes
title: Fixes by autopep8 action
@ -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_body=$pr_body" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
@ -566,7 +566,7 @@ The template is rendered using the [render-template](https://github.com/chuhlomi
bar: that
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
body: ${{ steps.template.outputs.result }}
```

View File

@ -1,19 +1,3 @@
## Updating from `v6` to `v7`
### Behaviour changes
- Action input `git-token` has been renamed `branch-token`, to be more clear about its purpose. The `branch-token` is the token that the action will use to create and update the branch.
- The action now handles requests that have been rate-limited by GitHub. Requests hitting a primary rate limit will retry twice, for a total of three attempts. Requests hitting a secondary rate limit will not be retried.
- The `pull-request-operation` output now returns `none` when no operation was executed.
- Removed deprecated output environment variable `PULL_REQUEST_NUMBER`. Please use the `pull-request-number` action output instead.
### What's new
- The action can now sign commits as `github-actions[bot]` when using `GITHUB_TOKEN`, or your own bot when using [GitHub App tokens](concepts-guidelines.md#authenticating-with-github-app-generated-tokens). See [commit signing](concepts-guidelines.md#commit-signature-verification-for-bots) for details.
- Action input `draft` now accepts a new value `always-true`. This will set the pull request to draft status when the pull request is updated, as well as on creation.
- A new action input `maintainer-can-modify` indicates whether [maintainers can modify](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) the pull request. The default is `true`, which retains the existing behaviour of the action.
- A new output `pull-request-commits-verified` returns `true` or `false`, indicating whether GitHub considers the signature of the branch's commits to be verified.
## Updating from `v5` to `v6`
### Behaviour changes

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "create-pull-request",
"version": "7.0.0",
"version": "6.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "create-pull-request",
"version": "7.0.0",
"version": "6.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1",

View File

@ -1,6 +1,6 @@
{
"name": "create-pull-request",
"version": "7.0.0",
"version": "6.0.0",
"private": true,
"description": "Creates a pull request for changes to your repository in the actions workspace",
"main": "lib/main.js",