I am trying to automate applying label to the GitHub PRs.
I came across this awesome GitHub Action I am not able to understand on where to put labels and any[] or all[]
This is what I have tried so far -
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler
name: Labeler
on: [pull_request]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
- name: Applying labels.
deployment:
- any: ['deployment/backend-stack/deployment.yaml']
As described in the official documentation you need to have two files in your .github/ folder:
.github/workflows/labeler.yml.github/labeler.ymlDifference of the key words any and all:
name: Labeler
on: [pull_request]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
deployment:
- any: ['deployment/backend-stack/deployment.yaml']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With