Skip to content

feat: add explicit port routing & go tools bump #904

feat: add explicit port routing & go tools bump

feat: add explicit port routing & go tools bump #904

name: pull_request_labeler
on:
pull_request:
types: [edited, opened, synchronize, reopened]
jobs:
# Check if the pull request is a fork
# We can assign labels to a pull request only if it originates from the original repository. If a
# contributor forks the repository and creates a pull request from their forked version, the labeler
# actions do not have permission to access the PR's content, thus unable to automatically add
# labels. In such cases, the repository maintainers will need to add labels manually until a
# better solution is found.
check_repository_origin:
runs-on: ubuntu-22.04
outputs:
fork: ${{ steps.check_repository_origin.outputs.fork }}
steps:
- name: Check the Pull Request origin
id: check_repository_origin
run: |
if [ "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.event.pull_request.base.repo.full_name }}" ]; then
echo "Pull Request is from the original repository."
echo "fork=false" >> $GITHUB_OUTPUT
else
echo "Pull Request is from a forked repository."
echo "fork=true" >> $GITHUB_OUTPUT
fi
# Auto assigne reviewers and PR author
add-reviews:
needs: check_repository_origin
runs-on: ubuntu-22.04
if: ${{ needs.check_repository_origin.outputs.fork == 'false' }}
steps:
- uses: kentaro-m/auto-assign-action@v1.2.5
with:
configuration-path: .github/config/auto-assign.yml
# Add source labels to the PR
label_based_on_source_lang:
permissions:
contents: read
pull-requests: write
needs: check_repository_origin
runs-on: ubuntu-22.04
if: ${{ needs.check_repository_origin.outputs.fork == 'false' }}
steps:
- uses: actions/labeler@v4
with:
configuration-path: .github/config/labeler.yml
# Add scope & type labels to the PR
label_based_on_title:
permissions:
contents: read
pull-requests: write
needs: check_repository_origin
runs-on: ubuntu-22.04
if: ${{ needs.check_repository_origin.outputs.fork == 'false' }}
steps:
- uses: github/issue-labeler@v3.1
with:
configuration-path: .github/config/title_label_config.yml
include-title: 1
repo-token: ${{ github.token }}
enable-versioned-regex: 0