Change to grep

This commit is contained in:
Matt DiMeglio 2026-02-07 23:55:12 -05:00
parent 0e0a5a8b87
commit 54cb49dd8a

View file

@ -113,20 +113,19 @@ jobs:
-H "Content-Type: application/json" \
-d "{\"buildType\": {\"id\": \"$TEAMCITY_BUILD_ID\"}}" \
"$TEAMCITY_URL/httpAuth/app/rest/buildQueue" \
| xmllint --xpath 'string(//build/@id)' -)
| grep -oP 'id="\K[0-9]+')
echo "Build queued with ID: $BUILD_ID"
# Query only the build state
BUILD_STATE=$(curl -s -u "$TEAMCITY_USER:$TEAMCITY_TOKEN" \
"$TEAMCITY_URL/httpAuth/app/rest/buildQueue/id:$BUILD_ID?fields=build(state)" \
| xmllint --xpath 'string(//build/@state)' -)
| grep -oP 'state="\K[^"]+')
echo "Build state: $BUILD_STATE"
# Set GitHub Actions output
echo "build_state=$BUILD_STATE" >> $GITHUB_OUTPUT
- name: Show Build State
run: echo "TeamCity build is ${{ steps.trigger.outputs.build_state }}"