Skip to content

refactor: Introduce internal semver compare module #623

refactor: Introduce internal semver compare module

refactor: Introduce internal semver compare module #623

Workflow file for this run

# Copyright 2026 "Google LLC"
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Label External PRs
on:
pull_request_target:
branches:
- develop
types:
- opened
- reopened
- synchronize
permissions:
issues: write
contents: read
actions: write
pull-requests: write
jobs:
label-external:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Add external label only for develop PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
AUTHOR="${{ github.event.pull_request.user.login }}"
PR_NUMBER="${{ github.event.pull_request.number }}"
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
echo "Author: $AUTHOR"
echo "Target branch: $TARGET_BRANCH"
# Extra safety check
if [ "$TARGET_BRANCH" != "develop" ]; then
echo "Not targeting develop → skipping"
exit 0
fi
INTERNAL_USERS=$(jq -r '.[].login' cluster-toolkit-writers.json)
if echo "$INTERNAL_USERS" | grep -qx "$AUTHOR"; then
echo "Internal user → no label"
else
echo "External user → adding label"
gh api \
repos/${{ github.repository }}/issues/$PR_NUMBER/labels \
-X POST \
-F labels[]=external || true
fi