Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'number') #2790

Comments

@stevelacey
Copy link

Subject of the issue

I started getting this error on v4, so upgraded to v6, but I'm still seeing it 🤔

Create or update the pull request
  Attempting creation of pull request
  A pull request already exists for example:branch
  Fetching existing pull request
  Attempting update of pull request
  Error: Cannot read properties of undefined (reading 'number')

Seems to only happen when there's an existing pull request, if I delete the existing one the workflow will succeed.

Steps to reproduce

Run the workflow with an existing pull request present.

    - uses: peter-evans/create-pull-request@v6
      with:
        title: Release ${{ inputs.next_version }}
        body: |
          ## Release [${{ inputs.next_version }}](${{ github.server_url }}/${{ github.repository }}/compare/${{ inputs.previous_version }}...${{ steps.commit.outputs.short }})

          ${{ inputs.notes }}
        author: GitHub <noreply@github.com>
        branch: release
        committer: GitHub <noreply@github.com>
        commit-message: |
          chore(release): ${{ inputs.next_version }}
        delete-branch: true

https://github.com/stevelacey/release-builder/blob/v1/pull-request/action.yml#L27C25-L39

@walterholohan
Copy link

Same here, starting happening a few hours ago

@peter-evans
Copy link
Owner

I've not made any changes to the action since releasing v6, so this looks like an issue with GitHub's API.

Reproduced the problem with my test suite.
https://github.com/peter-evans/create-pull-request-tests/actions/runs/8071848530

I'll make a GitHub support ticket.

@peter-evans
Copy link
Owner

Created a GitHub support ticket for this issue. Thanks for reporting it.

@peter-evans
Copy link
Owner

I'm trying to confirm with GitHub support, but it looks like there was a bug with GitHub's list pull requests API that just got fixed. It appears I was unknowingly working around this bug for about 2 years! In fixing it they've caused a breaking change.

@peter-evans
Copy link
Owner

Released v6.0.1 / v6.

Please note that I'm assuming that GitHub are not going to roll this change back. 😓 I'm trying to confirm with GitHub support that it was actually a long standing bug that just got fixed.

@peter-evans peter-evans pinned this issue Feb 28, 2024
johnnyomair added a commit to vivid-planet/comet that referenced this issue Feb 28, 2024
Need an update to create-pull-request@v6 to fix [an issue with the GitHub API](peter-evans/create-pull-request#2790).
johnnyomair added a commit to vivid-planet/comet that referenced this issue Feb 28, 2024
Need an update to create-pull-request@v6 to fix [an issue with the
GitHub
API](peter-evans/create-pull-request#2790).
@peter-evans
Copy link
Owner

GitHub support have confirmed that an intentional change was made to the list API, and the fix they suggested to me (released as v6.0.1 / v6) should be good from now on. Not expecting this change to be rolled back.

Artemis-chan added a commit to Artemis-chan/osu-DIVA that referenced this issue Mar 6, 2024
denniskigen added a commit to openmrs/openmrs-esm-patient-chart that referenced this issue Mar 7, 2024
)

* Add functionality to allow deleting and editing an allergy

(feat) O3-2760: Add a `closeWorkspaceWithSavedChanges` function to the workspace API (#1689)

* Added new function 'closeWorkspaceWithSavedChanges' to close workspace after form is saved

* Passing 'closeWorkspaceWithSavedChanges' as workspace props

(docs) Amend steps for updating core libraries in README (#1690)

(chore) Bump @openmrs/ngx-formentry (#1684)

(fix) O3 2804: Reuse the ResponsiveWrapper component from esm-framework (#1673)

* (feat) Reuse ResponsiveWrapper component from esm-framework

* feat: Added Layer in visit-notes-form

* Fix styleguide imports by bumping both openmrs tooling and framework

* Misc fixes

---------

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

(refactor) O3-2815: Replace usages of `/ws/rest/v1` with `restBaseUrl` (#1661)

* (Refactor)O3-2815: Replace usages of '/ws/rest/v1' with restBaseUrl

* Fixup

---------

Co-authored-by: jwnasambu <wamalwa1844.com>
Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

(feat) Add ability to cancel orders (#1640)

* (feat) cancel order

* clean up

* pr changes, reload fixes and clean up

* translations

* wip cancel order via action

* mutate orders on cancel

* order mutations and pr comments

* fixes to labs

* button text change

* Fixup

* More tweaks

---------

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

(chore) Add generic slot to Visit Form (#1688)

* (chore) Add billing slot to Start Visit Form

* Add generic visit attribute slot

* remove slot from config

---------

Co-authored-by: CynthiaKamau <cynthiakamau54@gmail.com>

(chore) Bump Angular form engine (#1694)

(feat) Makes orders widget expandable and adds detailed order view (#1696)

* (feat) Expandable orders widget

* adds order item cards when expanded

* changes button to tooltip

(fix) O3-2629: Submit button on Allergy Form remains disabled when filling allergen and severity before reactions (#1699)

fix the allergy reaction dependency

(feat) Hide bottom navigation on tablets and phones when workspace is active (#1695)

(feat) Relocate Load More button in visits section (#1702)

(chore) Relocate Load More button in visits section

add closeWorkspaceWithSavedChanges argument to Allergy form

parameterised allergy reaction should be checked correctly

maintain non-coded allergen array

remove test

(chore) Prettier should only list files that don't formatting config

(feat) Add config to handle bill submission in start visit form (#1700)

Upgrade peter-evans/create-pull-request

See peter-evans/create-pull-request#2790

(chore) Update translations from Transifex (#1683)

add test

fix added test

* clean deletePatientAllergy function

* Update packages/esm-patient-allergies-app/src/allergies/allergies-form/allergy-form.component.tsx

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

* Update packages/esm-patient-allergies-app/src/allergies/allergies-form/allergy-form.test.tsx

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

* Update packages/esm-patient-allergies-app/src/allergies/allergies-form/allergy-form.resource.ts

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

* (chore) Bump @openmrs/ngx-formentry

* make default allergy loading more clean

* fix linting

---------

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>
bfabio added a commit to italia/publiccode-parser-go that referenced this issue Mar 8, 2024
Upgrade `peter-evans/create-pull-request` as GitHub changed
their API and v6 is required to work properly.

See peter-evans/create-pull-request#2790.
bfabio added a commit to italia/publiccode-parser-go that referenced this issue Mar 8, 2024
Upgrade `peter-evans/create-pull-request` as GitHub changed
their API and v6 is required to work properly.

See peter-evans/create-pull-request#2790.
usamaidrsk pushed a commit to usamaidrsk/openmrs-esm-patient-chart that referenced this issue Mar 11, 2024
usamaidrsk pushed a commit to usamaidrsk/openmrs-esm-patient-chart that referenced this issue Mar 11, 2024
…enmrs#1703)

* Add functionality to allow deleting and editing an allergy

(feat) O3-2760: Add a `closeWorkspaceWithSavedChanges` function to the workspace API (openmrs#1689)

* Added new function 'closeWorkspaceWithSavedChanges' to close workspace after form is saved

* Passing 'closeWorkspaceWithSavedChanges' as workspace props

(docs) Amend steps for updating core libraries in README (openmrs#1690)

(chore) Bump @openmrs/ngx-formentry (openmrs#1684)

(fix) O3 2804: Reuse the ResponsiveWrapper component from esm-framework (openmrs#1673)

* (feat) Reuse ResponsiveWrapper component from esm-framework

* feat: Added Layer in visit-notes-form

* Fix styleguide imports by bumping both openmrs tooling and framework

* Misc fixes

---------

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

(refactor) O3-2815: Replace usages of `/ws/rest/v1` with `restBaseUrl` (openmrs#1661)

* (Refactor)O3-2815: Replace usages of '/ws/rest/v1' with restBaseUrl

* Fixup

---------

Co-authored-by: jwnasambu <wamalwa1844.com>
Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

(feat) Add ability to cancel orders (openmrs#1640)

* (feat) cancel order

* clean up

* pr changes, reload fixes and clean up

* translations

* wip cancel order via action

* mutate orders on cancel

* order mutations and pr comments

* fixes to labs

* button text change

* Fixup

* More tweaks

---------

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

(chore) Add generic slot to Visit Form (openmrs#1688)

* (chore) Add billing slot to Start Visit Form

* Add generic visit attribute slot

* remove slot from config

---------

Co-authored-by: CynthiaKamau <cynthiakamau54@gmail.com>

(chore) Bump Angular form engine (openmrs#1694)

(feat) Makes orders widget expandable and adds detailed order view (openmrs#1696)

* (feat) Expandable orders widget

* adds order item cards when expanded

* changes button to tooltip

(fix) O3-2629: Submit button on Allergy Form remains disabled when filling allergen and severity before reactions (openmrs#1699)

fix the allergy reaction dependency

(feat) Hide bottom navigation on tablets and phones when workspace is active (openmrs#1695)

(feat) Relocate Load More button in visits section (openmrs#1702)

(chore) Relocate Load More button in visits section

add closeWorkspaceWithSavedChanges argument to Allergy form

parameterised allergy reaction should be checked correctly

maintain non-coded allergen array

remove test

(chore) Prettier should only list files that don't formatting config

(feat) Add config to handle bill submission in start visit form (openmrs#1700)

Upgrade peter-evans/create-pull-request

See peter-evans/create-pull-request#2790

(chore) Update translations from Transifex (openmrs#1683)

add test

fix added test

* clean deletePatientAllergy function

* Update packages/esm-patient-allergies-app/src/allergies/allergies-form/allergy-form.component.tsx

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

* Update packages/esm-patient-allergies-app/src/allergies/allergies-form/allergy-form.test.tsx

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

* Update packages/esm-patient-allergies-app/src/allergies/allergies-form/allergy-form.resource.ts

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>

* (chore) Bump @openmrs/ngx-formentry

* make default allergy loading more clean

* fix linting

---------

Co-authored-by: Dennis Kigen <kigen.work@gmail.com>
na4zagin3 added a commit to na4zagin3/satyrographos-repo that referenced this issue Mar 14, 2024
peter-evans/create-pull-request v6 supports the upstream change peter-evans/create-pull-request#2790
na4zagin3 added a commit to na4zagin3/satyrographos-repo that referenced this issue Mar 14, 2024
peter-evans/create-pull-request v6 supports the upstream change peter-evans/create-pull-request#2790
AiroPi added a commit to mybot-organization/mybot that referenced this issue Mar 16, 2024
This fix a [bug](peter-evans/create-pull-request#2790) that occurs on PR creation when the "same" pull request already exist.
@peter-evans
Copy link
Owner

peter-evans commented Mar 20, 2024

Due to another issue preventing some users from being able to use v6, this fix is now backported to v5 in v5.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment