Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/parity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ on:
jobs:
setup-matrix:
runs-on: ubuntu-latest
# actions:write lets the step below rename this run via the REST API.
permissions:
actions: write
outputs:
arch-matrix: ${{ steps.parse.outputs.matrix }}
prefix: ${{ steps.parse.outputs.prefix }}
Expand Down Expand Up @@ -133,6 +136,30 @@ jobs:
echo "prefix=$PREFIX" >> "$GITHUB_OUTPUT"
echo "Artifact prefix: $PREFIX"

- name: Add commit SHA to run name (PR runs)
# run-name is evaluated once when the run starts, so it can't include the
# commit SHA that download_testlogs resolves later from the PR id. For
# PR-triggered runs we resolve the PR head SHA here and PATCH the run
# name so it reads "PR <id> · <sha> · <archs>". The PR->SHA lookup is
# intentionally duplicated (download_testlogs keeps its own copy so it
# can still be run standalone with just --pr_id).
if: ${{ inputs.pr_id && !inputs.baseline_sha && !inputs.csv_name }}
env:
GH_TOKEN: ${{ github.token }}
PR_ID: ${{ inputs.pr_id }}
AUTOPARITY: ${{ inputs.auto_triggered && 'autoparity-' || '' }}
ARCH: ${{ inputs.arch }}
run: |
set -euo pipefail
SHA=$(gh api "repos/pytorch/pytorch/pulls/${PR_ID}" --jq '.head.sha' 2>/dev/null || true)
if [ -z "$SHA" ] || [ "$SHA" = "null" ]; then
echo "Could not resolve head SHA for PR ${PR_ID}; leaving run name unchanged."
exit 0
fi
NAME="${AUTOPARITY}PR ${PR_ID} · ${SHA} · ${ARCH}"
echo "Renaming run to: ${NAME}"
gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" -X PATCH -f name="${NAME}"

generate-parity:
needs: setup-matrix
runs-on: ubuntu-latest
Expand Down