diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..79f403a9 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,10 @@ +# Configuration for automatic PR labeling based on file changes +# https://github.com/actions/labeler + +# CLI - Command Line Interface +"area: cli": + - changed-files: + - any-glob-to-any-file: + - 'Sources/CLI/**/*' + - 'Sources/ContainerCommands/**/*' + diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..196df1ec --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,32 @@ +name: "Pull Request Labeler" + +on: + pull_request: + types: [opened] + +permissions: + contents: read + pull-requests: write + +jobs: + label: + name: Label Pull Request + if: github.repository == 'apple/container' + runs-on: ubuntu-latest + outputs: + labels-applied: ${{ steps.labeler.outputs.labels-applied }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Apply labels based on file changes + id: labeler + uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler.yml + sync-labels: true + +