scala-steward-org / scala-steward-action

A Github Action to launch Scala Steward in your repository
Apache License 2.0
136 stars 45 forks source link

[FEATURE REQUEST] Pr labels #245

Closed TonioGela closed 2 years ago

TonioGela commented 3 years ago

I don't know if this is the correct way to asking it, but it would be nice having a setting like labels that instructs scala-steward to add the listed labels to the PR it opens. I don't know if the label has to be previously created in the repository.

I'm asking it in order to be able to write a mergify configuration that checks for the presence of a label like [dependency-update] before merging, since relying on the username and build status is a thing that triggers both scala-steward and standard pull requests.

Feel free to close it if this is not the way to ask for a feature. Thanks!

TonioGela commented 3 years ago

Okay, it's probably a duplicated of this: https://github.com/scala-steward-org/scala-steward/issues/1471

alejandrohdezma commented 3 years ago

Hey @TonioGela, since Scala Steward always creates PRs as update/* you can use other GitHub Actions in your "main" workflow to label PRs depending on the branch (or even body contents). Here are some examples of said actions:

And here is an example of how I do it for my own repositories.

However, I think it would be awesome to have this feature directly in Scala Steward, so I'll leave this open to track progress of the linked issue.

TonioGela commented 3 years ago

Yes, I resorted using Update .* to .* to match the pull request name as a toggle for mergify, but I'll take a look at the examples you gave me. I'll see whether I'm able to contribute to the main project to add this feature btw. Thanks again

alejandrohdezma commented 2 years ago

Hi! After https://github.com/scala-steward-org/scala-steward/pull/2523 this can be done now using the other-args input:

- name: Launch Scala Steward
  uses: scala-steward-org/scala-steward-action@v2
  with:
    github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
    other-args: '--add-labels'