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

pr-label doesn't apply label #112

Open
antifuchs opened this issue Feb 16, 2024 · 2 comments
Open

pr-label doesn't apply label #112

antifuchs opened this issue Feb 16, 2024 · 2 comments

Comments

@antifuchs
Copy link

antifuchs commented Feb 16, 2024

I invoke the action similar to the template given in the readme, like so:

      - uses: cargo-bins/release-pr@v2
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          version: ${{ inputs.version }}
          check-semver: true
          pr-label: "release"
          pr-draft: true

But when it creates a PR, the label isn't applied (but the "draft" status is). The PR label exists and can be manually applied.

Is this some limitation in GH actions/api that I'm running into, or is this a bug?

@passcod
Copy link
Member

passcod commented Feb 16, 2024

Yeah, we ran into this with cargo-binstall and I wasn't able to resolve it for there, was very confused at the time.

@antifuchs
Copy link
Author

Glad to hear I'm not the only one! Here's the workaround I came up with:

      - uses: cargo-bins/release-pr@v2
        id: pr
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          version: ${{ inputs.version }}
          check-semver: true
      - uses: actions-ecosystem/action-regex-match@v2
        id: pr-id
        with:
          text: ${{ steps.pr.outputs.pr-url }}
          regex: "/pull/([0-9]+)$"
      - uses: actions-ecosystem/action-add-labels@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          labels: release
          number: ${{ steps.pr-id.outputs.group1 }}

In a way, it composes more nicely, but it would be neater to not have to regex-munge the PR URL (instead, get the number from the action's outputs directly).

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