Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8867c4a
fix: handle ambiguous argument failure on diff stat (#3312)
peter-evans Sep 5, 2024
5354f85
docs: update readme
peter-evans Sep 9, 2024
488c869
build(deps-dev): bump @types/node from 18.19.48 to 18.19.50 (#3320)
dependabot[bot] Sep 10, 2024
f4d66f4
build(deps-dev): bump typescript from 5.5.4 to 5.6.2 (#3319)
dependabot[bot] Sep 10, 2024
d121e62
fix: disable diff detection for renames and copies (#3330)
peter-evans Sep 12, 2024
6cd32fd
fix: disable abbreviated commit shas in diff (#3337)
peter-evans Sep 16, 2024
f6f978f
docs: correct suggestion for bot setup (#3342)
henryiii Sep 16, 2024
d39d596
build(deps-dev): bump @types/jest from 29.5.12 to 29.5.13 (#3343)
dependabot[bot] Sep 17, 2024
7a8aeac
build(deps-dev): bump eslint from 8.57.0 to 8.57.1 (#3344)
dependabot[bot] Sep 17, 2024
2f38cd2
fix: support submodules when commit signing (#3354)
peter-evans Sep 18, 2024
5e91468
fix: support symlinks when commit signing (#3359)
peter-evans Sep 18, 2024
d24ced9
build(deps-dev): bump @vercel/ncc from 0.38.1 to 0.38.2 (#3365)
dependabot[bot] Sep 24, 2024
7920c48
build: update distribution (#3370)
actions-bot Sep 24, 2024
6d225c2
build(deps): bump @octokit/plugin-rest-endpoint-methods (#3375)
dependabot[bot] Oct 1, 2024
f495c14
build(deps-dev): bump @types/node from 18.19.50 to 18.19.54 (#3376)
dependabot[bot] Oct 1, 2024
4a018ca
build(deps): bump @octokit/plugin-paginate-rest from 11.3.3 to 11.3.5…
dependabot[bot] Oct 1, 2024
5fb55cc
build: update distribution (#3388)
actions-bot Oct 1, 2024
e60c9f9
build(deps-dev): bump @types/node from 18.19.54 to 18.19.55 (#3400)
dependabot[bot] Oct 8, 2024
91d9b1a
build(deps): bump @actions/core from 1.10.1 to 1.11.1 (#3401)
dependabot[bot] Oct 8, 2024
6a95549
build(deps): bump @octokit/plugin-rest-endpoint-methods (#3403)
dependabot[bot] Oct 8, 2024
31f0a78
build(deps-dev): bump eslint-plugin-import from 2.30.0 to 2.31.0 (#3402)
dependabot[bot] Oct 8, 2024
fecb38a
build(deps): bump @octokit/plugin-throttling from 9.3.1 to 9.3.2 (#3404)
dependabot[bot] Oct 8, 2024
41fe70d
build: update distribution (#3423)
actions-bot Oct 8, 2024
7f04a93
build(deps-dev): bump typescript from 5.6.2 to 5.6.3 (#3441)
dependabot[bot] Oct 15, 2024
36234c3
build(deps): bump undici from 6.19.8 to 6.20.1 (#3442)
dependabot[bot] Oct 15, 2024
dcbbee9
build: update distribution (#3451)
actions-bot Oct 15, 2024
2b17eaf
build(deps-dev): bump @types/node from 18.19.55 to 18.19.58 (#3457)
dependabot[bot] Oct 22, 2024
f3328ea
build(deps-dev): bump @types/jest from 29.5.13 to 29.5.14 (#3462)
dependabot[bot] Oct 29, 2024
5da4e80
build(deps-dev): bump @types/node from 18.19.58 to 18.19.60 (#3463)
dependabot[bot] Oct 29, 2024
2aadff0
chore: don't bundle undici (#3475)
benmccann Nov 4, 2024
6d751ce
build: update distribution (#3478)
actions-bot Nov 4, 2024
0c478ad
chore: use node-fetch-native support for proxy env vars (#3483)
peter-evans Nov 4, 2024
56c2d95
build(deps-dev): bump @types/node from 18.19.60 to 18.19.64 (#3488)
dependabot[bot] Nov 5, 2024
48e0547
build(deps-dev): bump undici from 6.20.1 to 6.21.0 (#3499)
dependabot[bot] Nov 19, 2024
ce71ba0
build(deps-dev): bump @vercel/ncc from 0.38.2 to 0.38.3 (#3500)
dependabot[bot] Nov 19, 2024
fb9d3b1
docs: note `push-to-repo` classic PAT `workflow` scope requirement (#…
scop Nov 25, 2024
28b3f12
docs: spelling fixes (#3512)
scop Nov 25, 2024
c8c4196
build(deps-dev): bump typescript from 5.6.3 to 5.7.2 (#3516)
dependabot[bot] Nov 26, 2024
059edeb
build(deps-dev): bump prettier from 3.3.3 to 3.4.0 (#3517)
dependabot[bot] Nov 26, 2024
2d6e2b8
build(deps-dev): bump @types/node from 18.19.64 to 18.19.66 (#3518)
dependabot[bot] Nov 26, 2024
fd32767
docs(README): clarify that an existing open PR is managed (#3498)
caugner Nov 26, 2024
5474387
docs: fix readme
peter-evans Nov 26, 2024
507d0a9
build: update distribution (#3529)
actions-bot Nov 26, 2024
25b6871
docs: update scopes for push-to-fork
peter-evans Nov 27, 2024
4e0cc19
build(deps): bump @octokit/plugin-paginate-rest from 11.3.5 to 11.3.6…
dependabot[bot] Dec 3, 2024
b27ce37
build(deps-dev): bump @types/node from 18.19.66 to 18.19.67 (#3543)
dependabot[bot] Dec 3, 2024
a22a0dd
build(deps-dev): bump prettier from 3.4.0 to 3.4.1 (#3544)
dependabot[bot] Dec 3, 2024
5bffd5a
build(deps-dev): bump eslint-import-resolver-typescript (#3559)
dependabot[bot] Dec 10, 2024
16e0059
build(deps-dev): bump prettier from 3.4.1 to 3.4.2 (#3560)
dependabot[bot] Dec 10, 2024
fa9200e
build(deps-dev): bump @types/node from 18.19.67 to 18.19.68 (#3570)
dependabot[bot] Dec 17, 2024
b378ed5
build(deps): bump p-limit from 6.1.0 to 6.2.0 (#3578)
dependabot[bot] Dec 24, 2024
bb88e27
build: update distribution (#3583)
actions-bot Dec 27, 2024
67ccf78
fix: preserve unicode in filepaths when commit signing (#3588)
peter-evans Dec 27, 2024
a302671
build(deps): bump @octokit/core from 6.1.2 to 6.1.3 (#3593)
dependabot[bot] Jan 7, 2025
8606317
build(deps-dev): bump @types/node from 18.19.68 to 18.19.70 (#3594)
dependabot[bot] Jan 7, 2025
ae3093d
build: update distribution (#3603)
actions-bot Jan 7, 2025
c52b9e2
build(deps-dev): bump typescript from 5.7.2 to 5.7.3 (#3610)
dependabot[bot] Jan 14, 2025
2539354
build(deps): bump octokit dependencies (#3618)
peter-evans Jan 16, 2025
c4623ef
docs: add workflow tip for showing message via workflow command (#3626)
ybiquitous Jan 21, 2025
16bbacf
build(deps-dev): bump eslint-plugin-prettier from 5.2.1 to 5.2.3 (#3628)
dependabot[bot] Jan 21, 2025
e23e628
build(deps): bump node-fetch-native from 1.6.4 to 1.6.6 (#3627)
dependabot[bot] Jan 21, 2025
9965b9d
build(deps-dev): bump undici from 6.21.0 to 6.21.1 (#3630)
dependabot[bot] Jan 21, 2025
842a5fb
build(deps-dev): bump @types/node from 18.19.70 to 18.19.71 (#3629)
dependabot[bot] Jan 21, 2025
176fdd2
build: update distribution (#3647)
actions-bot Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Create Pull Request action will:
- tracked (modified) files
- commits made during the workflow that have not been pushed
2. Commit all changes to a new branch, or update an existing pull request branch.
3. Create a pull request to merge the new branch into the base—the branch checked out in the workflow.
3. Create or update a pull request to merge the branch into the base—the branch checked out in the workflow.

## Documentation

Expand Down Expand Up @@ -99,7 +99,7 @@ Other token options:
#### branch-token

The action first creates a branch, and then creates a pull request for the branch.
For some rare use cases it can be useful, or even neccessary, to use different tokens for these operations.
For some rare use cases it can be useful, or even necessary, to use different tokens for these operations.
It is not advisable to use this input unless you know you need to.

#### commit-message
Expand Down Expand Up @@ -246,26 +246,6 @@ Note that the repository must be checked out on a branch with a remote, it won't
uses: peter-evans/create-pull-request@v7
```

<!--
### Create a project card

To create a project card for the pull request, pass the `pull-request-number` step output to [create-or-update-project-card](https://github.com/peter-evans/create-or-update-project-card) action.

```yml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7

- name: Create or Update Project Card
if: ${{ steps.cpr.outputs.pull-request-number }}
uses: peter-evans/create-or-update-project-card@v2
with:
project-name: My project
column-name: My column
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
```
-->

### Auto-merge

Auto-merge can be enabled on a pull request allowing it to be automatically merged once requirements have been satisfied.
Expand Down
39 changes: 25 additions & 14 deletions __test__/create-or-update-branch.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,15 @@ describe('create-or-update-branch tests', () => {
expect(branchCommits.length).toEqual(1)
expect(branchCommits[0].subject).toEqual('Test changes')
expect(branchCommits[0].changes.length).toEqual(3)
expect(branchCommits[0].changes).toEqual([
{mode: '100755', path: UNTRACKED_EXE_FILE, status: 'A'},
{mode: '100644', path: TRACKED_FILE, status: 'M'},
{mode: '100644', path: UNTRACKED_FILE, status: 'A'}
])
expect(branchCommits[0].changes[0].mode).toEqual('100755')
expect(branchCommits[0].changes[0].path).toEqual(UNTRACKED_EXE_FILE)
expect(branchCommits[0].changes[0].status).toEqual('A')
expect(branchCommits[0].changes[1].mode).toEqual('100644')
expect(branchCommits[0].changes[1].path).toEqual(TRACKED_FILE)
expect(branchCommits[0].changes[1].status).toEqual('M')
expect(branchCommits[0].changes[2].mode).toEqual('100644')
expect(branchCommits[0].changes[2].path).toEqual(UNTRACKED_FILE)
expect(branchCommits[0].changes[2].status).toEqual('A')
})

it('tests buildBranchCommits with addition and deletion', async () => {
Expand All @@ -272,11 +276,15 @@ describe('create-or-update-branch tests', () => {
expect(branchCommits.length).toEqual(1)
expect(branchCommits[0].subject).toEqual('Test changes')
expect(branchCommits[0].changes.length).toEqual(3)
expect(branchCommits[0].changes).toEqual([
{mode: '100644', path: TRACKED_FILE, status: 'D'},
{mode: '100644', path: UNTRACKED_FILE, status: 'A'},
{mode: '100644', path: TRACKED_FILE_NEW_PATH, status: 'A'}
])
expect(branchCommits[0].changes[0].mode).toEqual('100644')
expect(branchCommits[0].changes[0].path).toEqual(TRACKED_FILE)
expect(branchCommits[0].changes[0].status).toEqual('D')
expect(branchCommits[0].changes[1].mode).toEqual('100644')
expect(branchCommits[0].changes[1].path).toEqual(UNTRACKED_FILE)
expect(branchCommits[0].changes[1].status).toEqual('A')
expect(branchCommits[0].changes[2].mode).toEqual('100644')
expect(branchCommits[0].changes[2].path).toEqual(TRACKED_FILE_NEW_PATH)
expect(branchCommits[0].changes[2].status).toEqual('A')
})

it('tests buildBranchCommits with multiple commits', async () => {
Expand All @@ -294,10 +302,13 @@ describe('create-or-update-branch tests', () => {
expect(branchCommits[i].subject).toEqual(`Test changes ${i}`)
expect(branchCommits[i].changes.length).toEqual(2)
const untrackedFileStatus = i == 0 ? 'A' : 'M'
expect(branchCommits[i].changes).toEqual([
{mode: '100644', path: TRACKED_FILE, status: 'M'},
{mode: '100644', path: UNTRACKED_FILE, status: untrackedFileStatus}
])

expect(branchCommits[i].changes[0].mode).toEqual('100644')
expect(branchCommits[i].changes[0].path).toEqual(TRACKED_FILE)
expect(branchCommits[i].changes[0].status).toEqual('M')
expect(branchCommits[i].changes[1].mode).toEqual('100644')
expect(branchCommits[i].changes[1].path).toEqual(UNTRACKED_FILE)
expect(branchCommits[i].changes[1].status).toEqual(untrackedFileStatus)
}
})

Expand Down
9 changes: 6 additions & 3 deletions __test__/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ git clone git://127.0.0.1/repos/test-base.git /git/local/repos/test-base
cd /git/local/repos/test-base
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
echo "#test-base" > README.md
echo "#test-base" > README→TEMP.md
git add .
git commit -m "initial commit"
git commit --allow-empty -m "empty commit for tests"
echo "#test-base :sparkles:" > README.md
echo "#test-base :sparkles:" > README→TEMP.md
git add .
git commit -m "add sparkles" -m "Change description:
- updates README.md to add sparkles to the title"
- updates README→TEMP.md to add sparkles to the title"
mv README→TEMP.md README.md
git add .
git commit -m "rename readme"
git push -u
git log -1 --pretty=oneline
git config --global --unset user.email
Expand Down
31 changes: 21 additions & 10 deletions __test__/git-command-manager.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,38 @@ describe('git-command-manager integration tests', () => {
})

it('tests getCommit', async () => {
const initialCommit = await git.getCommit('HEAD^^')
const emptyCommit = await git.getCommit('HEAD^')
const initialCommit = await git.getCommit('HEAD^^^')
const emptyCommit = await git.getCommit('HEAD^^')
const modifiedCommit = await git.getCommit('HEAD^')
const headCommit = await git.getCommit('HEAD')

expect(initialCommit.subject).toEqual('initial commit')
expect(initialCommit.signed).toBeFalsy()
expect(initialCommit.changes).toEqual([
{mode: '100644', status: 'A', path: 'README.md'}
])
expect(initialCommit.changes[0].mode).toEqual('100644')
expect(initialCommit.changes[0].status).toEqual('A')
expect(initialCommit.changes[0].path).toEqual('README→TEMP.md') // filename contains unicode

expect(emptyCommit.subject).toEqual('empty commit for tests')
expect(emptyCommit.tree).toEqual(initialCommit.tree) // empty commits have no tree and reference the parent's
expect(emptyCommit.parents[0]).toEqual(initialCommit.sha)
expect(emptyCommit.signed).toBeFalsy()
expect(emptyCommit.changes).toEqual([])

expect(headCommit.subject).toEqual('add sparkles')
expect(headCommit.parents[0]).toEqual(emptyCommit.sha)
expect(modifiedCommit.subject).toEqual('add sparkles')
expect(modifiedCommit.parents[0]).toEqual(emptyCommit.sha)
expect(modifiedCommit.signed).toBeFalsy()
expect(modifiedCommit.changes[0].mode).toEqual('100644')
expect(modifiedCommit.changes[0].status).toEqual('M')
expect(modifiedCommit.changes[0].path).toEqual('README→TEMP.md')

expect(headCommit.subject).toEqual('rename readme')
expect(headCommit.parents[0]).toEqual(modifiedCommit.sha)
expect(headCommit.signed).toBeFalsy()
expect(headCommit.changes).toEqual([
{mode: '100644', status: 'M', path: 'README.md'}
])
expect(headCommit.changes[0].mode).toEqual('100644')
expect(headCommit.changes[0].status).toEqual('A')
expect(headCommit.changes[0].path).toEqual('README.md')
expect(headCommit.changes[1].mode).toEqual('100644')
expect(headCommit.changes[1].status).toEqual('D')
expect(headCommit.changes[1].path).toEqual('README→TEMP.md')
})
})
16 changes: 16 additions & 0 deletions dist/790.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading