Files
dotnet__skills/.github/workflows/shared/pat_pool.md
Jeff Handley f2282da6eb Require environment input to pat_pool shared workflow. Improve docs.
- Updates the PAT pool shared workflow to latest version
- This requires an input of the agentic environment
- The updated workflow import also addresses the previous issue where
  consuming workflows had to declare a 'needs' on the pat_pool job
- The issue-triage job has a new flavor of that 'needs' issue though
  since it uses 'roles: all', which eliminates the pre_activation job;
  so another workaround is applied there (an skip-if-no-match query).
2026-06-25 00:41:40 -07:00

4.0 KiB
Raw Permalink Blame History

description, jobs, import-schema
description jobs import-schema
Agentic workflow import to integrate the Copilot PAT Pool
pat_pool
environment needs runs-on outputs steps
${{ github.aw.import-inputs.environment }}
pre_activation
ubuntu-slim
pat_number
${{ steps.select-pat-number.outputs.copilot_pat_number }}
id name env shell run
select-pat-number Select Copilot token from pool
COPILOT_PAT_0 COPILOT_PAT_1 COPILOT_PAT_2 COPILOT_PAT_3 COPILOT_PAT_4 COPILOT_PAT_5 COPILOT_PAT_6 COPILOT_PAT_7 COPILOT_PAT_8 COPILOT_PAT_9 RANDOM_SEED
${{ github.aw.import-inputs.COPILOT_PAT_0 }} ${{ github.aw.import-inputs.COPILOT_PAT_1 }} ${{ github.aw.import-inputs.COPILOT_PAT_2 }} ${{ github.aw.import-inputs.COPILOT_PAT_3 }} ${{ github.aw.import-inputs.COPILOT_PAT_4 }} ${{ github.aw.import-inputs.COPILOT_PAT_5 }} ${{ github.aw.import-inputs.COPILOT_PAT_6 }} ${{ github.aw.import-inputs.COPILOT_PAT_7 }} ${{ github.aw.import-inputs.COPILOT_PAT_8 }} ${{ github.aw.import-inputs.COPILOT_PAT_9 }} ${{ github.aw.import-inputs.random_seed }}
bash # Collect pool entries with non-empty secrets from COPILOT_PAT_0..COPILOT_PAT_9. PAT_NUMBERS=() POOL_INDICATORS=(➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖ ➖) for i in $(seq 0 9); do var="COPILOT_PAT_${i}" val="${!var}" if [ -n "$val" ]; then PAT_NUMBERS+=(${i}) POOL_INDICATORS[${i}]="🟪" fi done # If none of the entries in the pool have values, emit a warning # and do not set an output value. The consumer can fall back to # using COPILOT_GITHUB_TOKEN. if [ ${#PAT_NUMBERS[@]} -eq 0 ]; then warning_message="::warning::None of the PAT pool entries had values " warning_message+="(checked COPILOT_PAT_0 through COPILOT_PAT_9)" echo "$warning_message" exit 0 fi # Select a random index using the seed if specified if [ -n "$RANDOM_SEED" ]; then RANDOM=$RANDOM_SEED fi PAT_INDEX=$(( RANDOM % ${#PAT_NUMBERS[@]} )) PAT_NUMBER="${PAT_NUMBERS[$PAT_INDEX]}" POOL_INDICATORS[${PAT_NUMBER}]="✅" echo "Pool size: ${#PAT_NUMBERS[@]}" echo "Selected PAT number ${PAT_NUMBER} (index: ${PAT_INDEX})" # Emit a markdown table of the pool entries to the step summary echo "|0|1|2|3|4|5|6|7|8|9|" >> "$GITHUB_STEP_SUMMARY" echo "|-|-|-|-|-|-|-|-|-|-|" >> "$GITHUB_STEP_SUMMARY" (IFS='|'; printf '|%s' "${POOL_INDICATORS[@]}"; printf '|\n') >> "$GITHUB_STEP_SUMMARY" # Set the PAT number as the output echo "copilot_pat_number=${PAT_NUMBER}" >> "$GITHUB_OUTPUT"
environment COPILOT_PAT_0 COPILOT_PAT_1 COPILOT_PAT_2 COPILOT_PAT_3 COPILOT_PAT_4 COPILOT_PAT_5 COPILOT_PAT_6 COPILOT_PAT_7 COPILOT_PAT_8 COPILOT_PAT_9 random_seed
type required
string true
type required default
string false ${{ secrets.COPILOT_PAT_0 }}
type required default
string false ${{ secrets.COPILOT_PAT_1 }}
type required default
string false ${{ secrets.COPILOT_PAT_2 }}
type required default
string false ${{ secrets.COPILOT_PAT_3 }}
type required default
string false ${{ secrets.COPILOT_PAT_4 }}
type required default
string false ${{ secrets.COPILOT_PAT_5 }}
type required default
string false ${{ secrets.COPILOT_PAT_6 }}
type required default
string false ${{ secrets.COPILOT_PAT_7 }}
type required default
string false ${{ secrets.COPILOT_PAT_8 }}
type required default
string false ${{ secrets.COPILOT_PAT_9 }}
type required description
number false A seed number to use for the random PAT number selection, for deterministic selection if needed.