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

Bug: Job fails but still creates the PR #123

Open
7tupel opened this issue Jun 15, 2023 · 6 comments
Open

Bug: Job fails but still creates the PR #123

7tupel opened this issue Jun 15, 2023 · 6 comments
Assignees
Labels
dependency Dependency update

Comments

@7tupel
Copy link

7tupel commented Jun 15, 2023

Description

Running the Action at the latest version (0.5.5) runs into an error. While GH shows an error, the PR is correctly created and visible in the PR view on GH. This step is the last in my workflow, so not critical at the moment, but it is not exactly helpful when a workflow run always shows as failed while it actually achieved what it should have.

Details

Error in the log (last two lines in the job's log):

Error updating issue: Unprocessable Entity (HTTP 422)
Invalid value for "name"

Job configuration in the workflow:

- name: Create Release PR
        id: create-pull-request 
        uses: devops-infra/action-pull-request@v0.5.5
        with:
          github_token: ${{ github.token }}
          target_branch: 'master'
          source_branch: 'release-${{ steps.timestamp.outputs.time }}'
          title: '[RELEASE] Create a new Release'
          body: Auto-generated by the _Create Release PR_ Action
          label: automated pr, release
          assignee: 7tupel

The output referenced in source_branch is correctly set and is correctly used by the action to create the PR.

My repository is public and available here: https://github.com/ClockworksIO/clci

@ChristophShyper ChristophShyper self-assigned this Jun 15, 2023
@ChristophShyper
Copy link
Member

hello @7tupel I'll have a look into it next week, as I'm AFK now.

@ChristophShyper
Copy link
Member

@7tupel I was able to recreate your issue.
It's caused by using single quotation marks in target_branch and source_branch.
You can use it without them or replace them with double quotation marks.
It's tricky with Actions, as they are not 100% compatible with YAML.

@ChristophShyper ChristophShyper added bugfix Bug needing a fix dependency Dependency update and removed bugfix Bug needing a fix labels Jun 20, 2023
@RifianFernando
Copy link

RifianFernando commented Jun 27, 2023

@7tupel I was able to recreate your issue. It's caused by using single quotation marks in target_branch and source_branch. You can use it without them or replace them with double quotation marks. It's tricky with Actions, as they are not 100% compatible with YAML.

Hi Christoph, I had the same issue too, and I used the single quotation on title, body, old_string, and ignore_users. I will try this double quotation, I'll let you know more about this issue later. Thankyou chris

    create-pr:
        needs: publish-npm
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
              with:
                  fetch-depth: 0
            - uses: devops-infra/action-pull-request@v0.5.5
              with:
                  github_token: ${{ secrets.GITHUB_TOKEN }}
                  source_branch: production
                  target_branch: master
                  title: 'ci: automated production sync to master'
                  body: '**Automated pull request**'
                  reviewer: RnDBNCC
                  assignee: RnDBNCC
                  label: automated-pr, automerge
                  template: .github/PULL_REQUEST_TEMPLATE.md
                  old_string: 'Explain the task'
                  get_diff: true
                  ignore_users: 'dependabot'
                  allow_no_diff: false
            - uses: reitermarkus/automerge@v2
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}
                  merge-method: squash
                  do-not-merge-labels: never-merge
                  required-labels: automerge
                  dry-run: true

@RifianFernando
Copy link

image
image
I think the label with coma is the problem?

@ChristophShyper
Copy link
Member

Do you have a space after the coma there? It should be just a coma.

@RifianFernando
Copy link

Do you have a space after the coma there? It should be just a coma.

oh, u're right thanks for the correct information chris, appreciate it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Dependency update
Development

No branches or pull requests

3 participants