From cdbbc49f41c581cadb431b9eacffd8fa8e34a004 Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Tue, 16 Jan 2024 16:20:58 +0100 Subject: [PATCH] chore(ci): Separate workflows by workflow trigger, rename config files --- .../{labeler.yml => pr-labels-by-path.yml} | 0 ...request-size.yml => pr-labels-by-size.yml} | 0 .github/workflows/pr-labeler.yml | 23 ++-------------- .github/workflows/pr-size-labeler.yml | 26 +++++++++++++++++++ 4 files changed, 28 insertions(+), 21 deletions(-) rename .github/{labeler.yml => pr-labels-by-path.yml} (100%) rename .github/{pull-request-size.yml => pr-labels-by-size.yml} (100%) create mode 100644 .github/workflows/pr-size-labeler.yml diff --git a/.github/labeler.yml b/.github/pr-labels-by-path.yml similarity index 100% rename from .github/labeler.yml rename to .github/pr-labels-by-path.yml diff --git a/.github/pull-request-size.yml b/.github/pr-labels-by-size.yml similarity index 100% rename from .github/pull-request-size.yml rename to .github/pr-labels-by-size.yml diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index 55984b314ba8d6d..771ebc5ecc2c28e 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -1,4 +1,4 @@ -name: Pull request labeler +name: Label PRs by path on: - pull_request_target @@ -16,24 +16,5 @@ jobs: steps: - uses: actions/labeler@v4 with: + configuration-path: ".github/pr-labels-by-path.yml" # Path to pr-path-labeler config repo-token: "${{ secrets.GITHUB_TOKEN }}" - - # Docs: https://github.com/cbrgm/pr-size-labeler-action - label-by-size: - # do not run on forks - if: github.repository == 'mdn/content' - needs: label-by-path - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Label PR based on size - uses: cbrgm/pr-size-labeler-action@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - github_repository: ${{ github.repository }} # Repository name - github_pr_number: ${{ github.event.number }} # Pull request number - config_file_path: ".github/pull-request-size.yml" # Path to pr-size-labeler config diff --git a/.github/workflows/pr-size-labeler.yml b/.github/workflows/pr-size-labeler.yml new file mode 100644 index 000000000000000..cedb85e3db66919 --- /dev/null +++ b/.github/workflows/pr-size-labeler.yml @@ -0,0 +1,26 @@ +name: Label PRs by size + +on: + pull_request: + branches: + - "main" + +jobs: + # Docs: https://github.com/cbrgm/pr-size-labeler-action + label-by-size: + # do not run on forks + if: github.repository == 'mdn/content' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Label PR based on size + uses: cbrgm/pr-size-labeler-action@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_repository: ${{ github.repository }} # Repository name + github_pr_number: ${{ github.event.number }} # Pull request number + config_file_path: ".github/pr-labels-by-size.yml" # Path to pr-size-labeler config