From 897ed0937a9c00fec3bfd23d01b9e9e3f08b0536 Mon Sep 17 00:00:00 2001 From: Matt Lehman Date: Fri, 13 Feb 2026 22:39:46 -0500 Subject: [PATCH] fix: set crates.io API headers in release publish checks --- .github/workflows/release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c4a228..f8a44b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -370,7 +370,10 @@ jobs: run: | set -euo pipefail version="${{ needs.create-release.outputs.version }}" - status="$(curl -sS -o /dev/null -w "%{http_code}" "https://crates.io/api/v1/crates/precursor/$version")" + status="$(curl -sS -o /dev/null -w "%{http_code}" \ + -H "User-Agent: precursor-release-ci" \ + -H "Accept: application/json" \ + "https://crates.io/api/v1/crates/precursor/$version")" if [ "$status" = "200" ]; then echo "already_published=true" >> "$GITHUB_OUTPUT" echo "precursor $version is already published on crates.io; skipping cargo publish." @@ -397,7 +400,10 @@ jobs: set -euo pipefail version="${{ needs.create-release.outputs.version }}" for attempt in $(seq 1 18); do - status="$(curl -sS -o /dev/null -w "%{http_code}" "https://crates.io/api/v1/crates/precursor/$version")" + status="$(curl -sS -o /dev/null -w "%{http_code}" \ + -H "User-Agent: precursor-release-ci" \ + -H "Accept: application/json" \ + "https://crates.io/api/v1/crates/precursor/$version")" if [ "$status" = "200" ]; then echo "Confirmed precursor $version on crates.io." exit 0