-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support Default Label #82
base: main
Are you sure you want to change the base?
Conversation
@TimonVS FYI |
Thanks for the contribution! I've been thinking about adding What are your thoughts on this? Would you be interested in contributing this? Example: name: PR Labeler
on:
pull_request:
types: [opened]
permissions:
contents: read
jobs:
pr-labeler:
runs-on: ubuntu-latest
permissions:
contents: read # for TimonVS/pr-labeler-action to read config
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
steps:
- uses: TimonVS/pr-labeler-action@v4
id: pr-labeler
with:
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
- uses: actions/github-script@v6
if: ${{ fromJSON(steps.pr-labeler.outputs.new-labels)[0] != null }}
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["default-label-here"]
}) |
I guess that would work (isn't the |
Sorry folks, I submitted this PR and then completely ignored feedback - tsk tsk! I think I agree with @w5l that leveraging the output can achieve a similar result, the user experience I think is nicer to have a catch-all I do agree that outputs should be added, it's always worth having some representation of the action taken so other actions can behave differently if desired. I've raised #86 to cover that functionality, and I will contribute that change. |
I've updated this branch based on the current state of |
the if condition you passed @TimonVS does not seem to work, managed to get it to work with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me 👍
Currently stuck waiting on the required |
Description
Fixes #52
Adds a new optional parameter
default-label
which can be leveraged in thewith
section.If this option is set, and no other label matches are found for the branch, the PR will be labelled with the label as supplied.