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

Failed to add label to PR in v1.4.0 #43

Closed
JBeresford opened this issue Oct 10, 2023 · 1 comment
Closed

Failed to add label to PR in v1.4.0 #43

JBeresford opened this issue Oct 10, 2023 · 1 comment

Comments

@JBeresford
Copy link

JBeresford commented Oct 10, 2023

We're currently running v1.3.7 of the action and everything is working as expected, however when I upgrade to run with v1.4.0 it fails with the following error:

Using config file .github/pr-title-checker-config.json from repo Owner/Repo [ref: ... ]
Creating label (title needs formatting)...
Label (title needs formatting) already created.
TypeError: Cannot read properties of undefined (reading 'notice')
Error: Failed to add label (title needs formatting) to PR

This is reproducible in the following workflow definition which works at v1.3.7 but fails as soon as I upgrade to v1.4.0

name: PR Title Checker

on:
  pull_request:
    types:
      - opened
      - reopened
      - edited
      - synchronize
      - labeled
    branches:
      - feature/*
      - sub-feature/*

jobs:
  pr_title_check:
    name: PR Title Check
    runs-on: windows-latest

    steps:
      - uses: thehanimo/pr-title-checker@v1.4.0
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The config is as follows:

{
  "LABEL": {
    "name": "title needs formatting",
    "color": "EEEEEE"
  },
  "CHECKS": {
    "regexp": "^((Feature|Sub-Feature) DEV-[0-9]+)|^Bump +"
  }
}
@thehanimo
Copy link
Owner

Thanks for bringing this up. There was a bug in the code that treated config.MESSAGES as mandatory. Pushed a fix in v1.4.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants