jefflinse / pr-semver-bump

A GitHub Action to bump and tag a new semantic version when a pull request is merged.
MIT License
24 stars 11 forks source link

noop-labels not working #49

Open dza89 opened 1 year ago

dza89 commented 1 year ago

Noob labels don't seem to work, config:

            - uses: jefflinse/pr-semver-bump@v1.6.0
              name: labels
              with:
                  mode: validate
                  repo-token: ${{ secrets.GITHUB_TOKEN }}
                  major-label: major
                  minor-label: minor
                  noop-labels:
                    - documentation change
                  patch-label: patch

Results in a: The workflow is not valid. .github/workflows/pull_request.yaml (Line: 110, Col: 21): A sequence was not expected

When I remove noop-labels it works fine.

The default in action.yaml is also an empty string, so something is up.

Edit: it works as a string.

jefflinse commented 1 year ago

@dza89 When you said it works as a string, do you mean that it works (and only works) when quoting the value? E.g.

noop-labels:
  - "documentation change"
dza89 commented 1 year ago

No, it works only as

noop-labels: "documentation change"

AbstractVersion commented 7 months ago

No, it works only as

noop-labels: "documentation change"

is it comma seperated eg. "documentation change, another label, etc" ?

rtizzy commented 6 months ago

@jefflinse

I can confirm the syntax is correct when passed in as a string as dza89 mentions.

Unfortunately the "no-op" still does not work.

As an example:

jobs:
  check-pr:
    name: Validate Release Label and Notes
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: jefflinse/pr-semver-bump@v1.6.0
        name: Validate Pull Request Metadata
        with:
          mode: validate
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          major-label: major
          minor-label: minor
          patch-label: patch
          # NOTE: Fix this when it's handled upstream
          noop-labels: nobump

Adding the nobump label to the PR still results in the following error

  with:
    mode: validate
    repo-token: ***
    major-label: major
    minor-label: minor
    patch-label: patch
    require-release-notes: false
    with-v: false
    base-branch: false
Error: PR validation failed: no release label specified on PR
rtizzy commented 6 months ago

For some additional context, this still does not work but it will at least be fed into the with

jobs:
  check-pr:
    name: Validate Release Label and Notes
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: jefflinse/pr-semver-bump@v1.6.0
        name: Validate Pull Request Metadata
        with:
          mode: validate
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          major-label: major
          minor-label: minor
          patch-label: patch
          # NOTE: Fix this when it's handled upstream
          noop-labels: 
            nobump
            testing
Run jefflinse/pr-semver-bump@v1.6.0
  with:
    mode: validate
    repo-token: ***
    major-label: major
    minor-label: minor
    patch-label: patch
    noop-labels: nobump testing
    require-release-notes: false
    with-v: false
    base-branch: false
rtizzy commented 6 months ago

@jefflinse

I figured out what will probably help you solve this

In my above example there are two tags specified for noop-labels, nobump and testing.

Tagging with either nobump or testing alone or together will still fail the job

Tagging it with nobump testing will allow the job to pass as expected.

You likely want to manage this by using some other type of list and ensuring that you're iterating over that list, don't think that is happening currently and it's instead seeing the space delimited tags as a single tag.

rtizzy commented 6 months ago

It's also worth noting that this will work

          noop-labels: 
            "nobump"

I believe this will also work

          noop-labels: 
            nobump

This WILL NOT work

          noop-labels:  "nobump"