Stirling-PDF/.github/workflows/auto-labelerV2.yml
Ludy 4ef2e4ab79
ci: restrict workflow to main branch PRs (#4677)
This pull request updates GitHub Actions workflow configuration files to
ensure that automated checks and labeling only run for pull requests
targeting specific branches, primarily `main`. This helps prevent
workflows from running unnecessarily on other branches and tightens
control over automation.

Workflow branch targeting updates:

* Updated `.github/workflows/auto-labelerV2.yml` to trigger the Auto
Pull Request Labeler V2 workflow only when pull requests target the
`main` or `V2` branches.
* Updated `.github/workflows/check_properties.yml` to trigger the check
only for pull requests targeting the `main` branch.

Workflow execution condition:

* Added a condition to the `check-files` job in
`.github/workflows/check_properties.yml` so it only runs if the pull
request's base branch is `main`.
2025-10-16 22:39:07 +01:00

39 lines
1022 B
YAML

name: "Auto Pull Request Labeler V2"
on:
pull_request_target:
types: [opened, synchronize]
branches:
- main
- V2
permissions:
contents: read
jobs:
labeler:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup GitHub App Bot
id: setup-bot
uses: ./.github/actions/setup-bot
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: srvaroa/labeler@0a20eccb8c94a1ee0bed5f16859aece1c45c3e55 # v1.13.0
with:
config_path: .github/labeler-config-srvaroa.yml
use_local_config: false
fail_on_error: true
env:
GITHUB_TOKEN: "${{ steps.setup-bot.outputs.token }}"