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

Auto-merging failed producing error related to pullRequest being null #993

Open
jethas-bennettjones opened this issue Jul 8, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@jethas-bennettjones
Copy link

jethas-bennettjones commented Jul 8, 2021

How would you describe the issue?

Attempting to perform an auto-merge, the step fails unexpectedly

How can we reproduce the issue?

Add this to the end of a build and packaging YAML file:

  auto-merge:
    needs:
      - package
    runs-on: ubuntu-latest
    steps:
      - uses: ridedott/merge-me-action@v2
        with:
          preset: DEPENDABOT_PATCH
          github_token: ${{ secrets.PULL_NPM }}

What are the expected results?

Error is produced (log below)

What are the actual results?

Merge should complete successfully

How much does it hurt?

Quite a lot, mostly because the feedback loop is pretty massive.

Here is the log output:

2021-07-08T15:17:50.8254989Z Found online and idle hosted runner(s) in the current repository's organization account that matches the required labels: 'ubuntu-latest'
2021-07-08T15:17:50.8255037Z Waiting for a hosted runner in 'organization' to pick this job...
2021-07-08T15:18:13.2215311Z Current runner version: '2.278.0'
2021-07-08T15:18:13.2244633Z ##[group]Operating System
2021-07-08T15:18:13.2245758Z Ubuntu
2021-07-08T15:18:13.2246135Z 20.04.2
2021-07-08T15:18:13.2246530Z LTS
2021-07-08T15:18:13.2246918Z ##[endgroup]
2021-07-08T15:18:13.2247432Z ##[group]Virtual Environment
2021-07-08T15:18:13.2248039Z Environment: ubuntu-20.04
2021-07-08T15:18:13.2248498Z Version: 20210628.1
2021-07-08T15:18:13.2249376Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20210628.1/images/linux/Ubuntu2004-README.md
2021-07-08T15:18:13.2250744Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20210628.1
2021-07-08T15:18:13.2251466Z ##[endgroup]
2021-07-08T15:18:13.2253185Z ##[group]GITHUB_TOKEN Permissions
2021-07-08T15:18:13.2254319Z Actions: write
2021-07-08T15:18:13.2254743Z Checks: write
2021-07-08T15:18:13.2255206Z Contents: write
2021-07-08T15:18:13.2255825Z Deployments: write
2021-07-08T15:18:13.2256375Z Discussions: write
2021-07-08T15:18:13.2256852Z Issues: write
2021-07-08T15:18:13.2257260Z Metadata: read
2021-07-08T15:18:13.2257699Z Packages: write
2021-07-08T15:18:13.2258194Z PullRequests: write
2021-07-08T15:18:13.2258687Z RepositoryProjects: write
2021-07-08T15:18:13.2259243Z SecurityEvents: write
2021-07-08T15:18:13.2259983Z Statuses: write
2021-07-08T15:18:13.2260571Z ##[endgroup]
2021-07-08T15:18:13.2263328Z Prepare workflow directory
2021-07-08T15:18:13.3041838Z Prepare all required actions
2021-07-08T15:18:13.3055004Z Getting action download info
2021-07-08T15:18:15.0688257Z Download action repository 'ridedott/merge-me-action@v2'
2021-07-08T15:18:15.8060213Z ##[group]Run ridedott/merge-me-action@v2
2021-07-08T15:18:15.8061241Z with:
2021-07-08T15:18:15.8061752Z   preset: DEPENDABOT_PATCH
2021-07-08T15:18:15.8063265Z   github_token: ***
2021-07-08T15:18:15.8063799Z   GITHUB_LOGIN: dependabot
2021-07-08T15:18:15.8064241Z   MERGE_METHOD: SQUASH
2021-07-08T15:18:15.8064750Z   ENABLED_FOR_MANUAL_CHANGES: false
2021-07-08T15:18:15.8065278Z   MAXIMUM_RETRIES: 3
2021-07-08T15:18:15.8065689Z env:
2021-07-08T15:18:15.8066252Z   webapp_path: BennettJones.EthicalWalls
2021-07-08T15:18:15.8066786Z ##[endgroup]
2021-07-08T15:18:16.4184499Z Automatic merges enabled for GitHub login: dependabot.
2021-07-08T15:18:16.4230498Z ##[error]An unexpected error occurred: Cannot read property 'pullRequest' of null, TypeError: Cannot read property 'pullRequest' of null
    at getPullRequestInformationByPullRequestNumber (/home/runner/work/_actions/ridedott/merge-me-action/v2/webpack:/@ridedott/merge-me-action/src/common/getPullRequestInformation.ts:68:1)
    at process.pullRequestInformation (internal/process/task_queues.js:93:5)
    at pullRequestInformation (/home/runner/work/_actions/ridedott/merge-me-action/v2/webpack:/@ridedott/merge-me-action/src/common/getPullRequestInformation.ts:125:1)
    at pullRequestHandle (/home/runner/work/_actions/ridedott/merge-me-action/v2/webpack:/@ridedott/merge-me-action/src/eventHandlers/pullRequest/index.ts:21:1).
2021-07-08T15:18:16.4279670Z Cleaning up orphan processes
@jethas-bennettjones jethas-bennettjones added the bug Something isn't working label Jul 8, 2021
@merlinnot
Copy link
Contributor

One thing I notice is that in your example inputs are lower case, whereas the action defines them as upper case, e.g. GITHUB_TOKEN instead of github_token. While most actions these days uses lower case names for inputs, this actions has been developed in early days of GitHub Actions when the guidelines weren't so clear. We might address that in the future, but for the time being, could you try upper case, as documented?

@jethas-bennettjones
Copy link
Author

@merlinnot Thanks for the tip. I had this as github-token before and when I changed it to github_token the Action didn't complain about it, so I could try this.
I ended up creating a separate YAML file that focused on performing the merge and that seems to have resolved the issue. Is it not intended to be put at the bottom of a YAML file like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants