Repository navigation
Update token to GITHUB_TOKEN #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow automatically applies labels to issues and pull requests | ||
| # based on regular expression matches against the content in the issue | ||
| # or pull request or file path pattern matches. | ||
| # | ||
| # The labels are declaratively defined in the following configuration files: | ||
| # - File Path Patterns: .sync/workflows/config/label-issues/file-paths.yml | ||
| # - Regular Expressions for Pull Requests: .sync/workflows/config/label-issues/regex-pull-requests.yml | ||
| # | ||
| # These will be mapped to the following directories in repos that use this reusable workflow: | ||
| # - File Path Patterns: .github/workflows/label-issues/file-paths.yml | ||
| # - Regular Expressions for Pull Requests: .github/workflows/label-issues/regex-pull-requests.yml | ||
| # | ||
| # Ideally, curl (or wget) could be used to grab the files from mu_devops in this workflow file and once on | ||
| # the local runner, the file path could simply be passed to the actions. That is not currently possible as | ||
| # the actions are hardcoded to use the GitHub REST API to get the files in the local repo. If that is fixed | ||
| # (tracked in https://github.com/github/issue-labeler/issues/39) then that approach can be used. | ||
| # | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # For more information, see: | ||
| # https://github.com/actions/labeler | ||
| # https://github.com/github/issue-labeler | ||
| name: Apply Labels Based on Message Content | ||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| GITHUB_TOKEN: | ||
| description: 'GitHub token for authentication' | ||
| required: true | ||
| jobs: | ||
| sync: | ||
| name: Label Based on Messages | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Apply Labels Based on PR File Paths | ||
| uses: actions/labeler@v4.3.0 | ||
| with: | ||
| configuration-path: .github/workflows/label-issues/file-paths.yml | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| sync-labels: true | ||
| if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||
| - name: Apply Labels Based on PR Messages | ||
| uses: github/issue-labeler@v3.4 | ||
| with: | ||
| configuration-path: .github/workflows/label-issues/regex-pull-requests.yml | ||
| enable-versioned-regex: 0 | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||