Support Default Label#82
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 |
|
Currently stuck waiting on the required |
Description
Fixes #52
Adds a new optional parameter
default-labelwhich can be leveraged in thewithsection.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.