Change to grep
This commit is contained in:
parent
0e0a5a8b87
commit
54cb49dd8a
1 changed files with 2 additions and 3 deletions
5
.github/workflows/api-deploy-nonprod.yml
vendored
5
.github/workflows/api-deploy-nonprod.yml
vendored
|
|
@ -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 }}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue