Skip to content

PR Creation fails #301

Description

@thiagodebastos

Problem

I cannot use the changeset Github action since it fails to create a PR, with the following error:

/usr/bin/git push origin HEAD:changeset-release/refs/pull/35/merge --force
To https://github.com/my-account/my-repo
 + 55fdd6e...d927a56 HEAD -> changeset-release/refs/pull/35/merge (forced update)
{
  "total_count": 0,
  "incomplete_results": false,
  "items": []
}
creating pull request
Error: HttpError: Validation Failed: {"resource":"PullRequest","field":"base","code":"invalid"}
Error: Validation Failed: {"resource":"PullRequest","field":"base","code":"invalid"}
HttpError: Validation Failed: {"resource":"PullRequest","field":"base","code":"invalid"}

I can see that the commit and branch are created. So that part works fine. I am unsure how to debug the rest.

I have tried setting baseBranch to master in .changeset/config.json but this does not help.

I have also tried setting all permissions to write in case the error message was incorrect.

Any pointers in the right direction would be great as I cannot seem to find any answers out there. I will report back if I find a solution.

This error would make sense if the action is attempting to create a PR from a fork, since that permission is disabled in our repo.

Relevant parts of workflow.yml

name: Build, Test and Lint

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}

jobs:
  test:
    name: Test and lint packages
    runs-on: self-hosted

    permissions:
      actions: write
      pull-requests: write
      statuses: write
      contents: write
      issues: write
      security-events: write
      pages: read

    steps:
      - name: Check out code
        uses: actions/checkout@v3
        with:
          path: master

      - name: Setup pnpm
        uses: pnpm/action-setup@v2
        with:
          version: 7.15.0

      - name: Use Node.js environment
        uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: "pnpm"
          always-auth: "true"

      - name: Install dependencies
        run: pnpm install

      - name: Build packages
        run: |
          pnpm build:packages

      - name: Create Release Pull Request or Publish to npm
        id: changesets
        uses: changesets/action@v1
        with:
          publish: pnpm release
          commit: "ci(changesets): version packages"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions