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