BUILD_RELEASE: debugging what is causing the exit from generate-body

This commit is contained in:
XargonWan 2024-11-13 15:16:42 +09:00
parent b1747c67dd
commit 4ebd861d24
2 changed files with 19 additions and 25 deletions

View file

@ -57,6 +57,17 @@ jobs:
- name: Generate cooker build ID - name: Generate cooker build ID
if: github.ref != 'refs/heads/main' if: github.ref != 'refs/heads/main'
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_build_id.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_build_id.sh"
# Getting branch name, this needs as PR should be managed in a different way
- name: Get Branch Name
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then
branch_name="$GITHUB_HEAD_REF"
else
branch_name="$GITHUB_REF_NAME"
fi
echo "Branch name: $branch_name"
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
# Generates a version tag based on the event type (main branch, PR, or cooker) and sets it as output. # Generates a version tag based on the event type (main branch, PR, or cooker) and sets it as output.
- name: Generate Version Tag - name: Generate Version Tag
@ -131,6 +142,12 @@ jobs:
# Export the commits list to the GitHub environment # Export the commits list to the GitHub environment
echo "COMMITS=$COMMITS" >> $GITHUB_ENV echo "COMMITS=$COMMITS" >> $GITHUB_ENV
- name: Extract XML Description
uses: Mudlet/xmlstarlet-action@v1
id: extract-description
with:
xml-file: "./net.retrodeck.retrodeck.appdata.xml"
xpath: "/component/releases/release[1]/description/*"
# Generate Release Body # Generate Release Body
- name: Generate release body text - name: Generate release body text
@ -143,30 +160,7 @@ jobs:
RELEASE_BODY+="## Commits since last release\n" RELEASE_BODY+="## Commits since last release\n"
RELEASE_BODY+="$COMMITS\n\n" RELEASE_BODY+="$COMMITS\n\n"
echo "[DEBUG] CHECKPOINT 1" raw_description="${{ steps.extract-description.outputs.result }}"
xml_file="./net.retrodeck.retrodeck.appdata.xml"
if [[ ! -f "$xml_file" ]]; then
echo "Error: XML file not found: $xml_file"
exit 1
fi
echo "[DEBUG] CHECKPOINT 2"
# Debug
xmlstarlet sel -t -m "/component/releases/release[1]/description/*" -c "." -n "$xml_file"
echo "[DEBUG] CHECKPOINT 2.1"
# Extract the raw description content using xmlstarlet with error handling
raw_description=$(xmlstarlet sel -t -m "/component/releases/release[1]/description/*" -c "." -n "$xml_file" 2>&1)
status=$?
if [[ $status -ne 0 ]]; then
echo "[ERROR] Failed to extract description content using xmlstarlet. Error output:"
echo "$raw_description"
exit 1
fi
echo "[DEBUG] CHECKPOINT 3" echo "[DEBUG] CHECKPOINT 3"

View file

@ -6,5 +6,5 @@ word2=$(shuf -n 1 ${GITHUB_WORKSPACE}/automation_tools/codename_wordlist.txt)
capitalized_word2="$(tr '[:lower:]' '[:upper:]' <<< ${word2:0:1})${word2:1}" capitalized_word2="$(tr '[:lower:]' '[:upper:]' <<< ${word2:0:1})${word2:1}"
result=$capitalized_word1$capitalized_word2 result=$capitalized_word1$capitalized_word2
echo $result > ${GITHUB_WORKSPACE}/buildid echo $result > ${GITHUB_WORKSPACE}/buildid
echo "buildid=$result" >> $GITHUB_ENV echo "BUILD_ID=$result" >> $GITHUB_ENV
echo "VersionID is $result" echo "VersionID is $result"