Skip to content

[release-24.0] CI: generate error code docs from trusted commits only (#20789) #6077

[release-24.0] CI: generate error code docs from trusted commits only (#20789)

[release-24.0] CI: generate error code docs from trusted commits only (#20789) #6077

name: Assign Milestone
on:
pull_request_target:
types: [opened]
permissions:
pull-requests: write
contents: read
env:
GH_TOKEN: ${{ github.token }}
jobs:
build:
name: Assign Milestone
runs-on: ubuntu-24.04
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# We must explicitly checkout the base's SHA to avoid executing any code coming from
# the PR's SHA - Which would be executed in the base branch's context.
# This is really important to limit any sort of pwn requests.
ref: ${{ github.base_ref }}
persist-credentials: 'false'
- name: Assign Milestone
run: |
# Ensure the content we sed from version.go is sanitized and match the correct format
VERSION=$(sed -n 's/.*versionName.*\"\([[:digit:]\.]*\).*\"/\1/p' ./go/vt/servenv/version.go)
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid version format: $VERSION"
exit 1
fi
gh pr edit ${{ github.event.number }} --milestone "v$VERSION"