fix: streamline output handling for conflict resolution in GitHub Actions
This commit is contained in:
parent
2651325af6
commit
96504367fc
6
.github/scripts/openai_resolver.py
vendored
6
.github/scripts/openai_resolver.py
vendored
@ -150,12 +150,10 @@ if __name__ == "__main__":
|
||||
# Output results for GitHub Actions
|
||||
print(f"CONFLICTS_RESOLVED={conflicts_resolved}")
|
||||
print(f"TOTAL_CONFLICTS={total_conflicts}")
|
||||
print(f"HAS_UNRESOLVED={failed_files.__len__() > 0}")
|
||||
|
||||
if failed_files:
|
||||
print("FAILED_FILES<<EOF")
|
||||
for file in failed_files:
|
||||
print(f"- {file}")
|
||||
print("EOF")
|
||||
print("FAILED_FILES=", " ".join(failed_files))
|
||||
|
||||
print(
|
||||
f"Resolution summary: {conflicts_resolved}/{total_conflicts} conflicts resolved"
|
||||
|
||||
14
.github/workflows/patch-node.yml
vendored
14
.github/workflows/patch-node.yml
vendored
@ -91,21 +91,13 @@ jobs:
|
||||
# Extract results from Python script output
|
||||
CONFLICTS_RESOLVED=$(grep "CONFLICTS_RESOLVED=" resolution_output.txt | cut -d'=' -f2)
|
||||
TOTAL_CONFLICTS=$(grep "TOTAL_CONFLICTS=" resolution_output.txt | cut -d'=' -f2)
|
||||
|
||||
HAS_UNRESOLVED=$(grep "HAS_UNRESOLVED=" resolution_output.txt | cut -d'=' -f2)
|
||||
FAILED_FILES_LINE=$(grep "FAILED_FILES=" resolution_output.txt | cut -d'=' -f2)
|
||||
|
||||
echo "PATCH_STATUS=conflicts" >> $GITHUB_ENV
|
||||
echo "CONFLICTS_RESOLVED=${CONFLICTS_RESOLVED:-0}" >> $GITHUB_ENV
|
||||
echo "TOTAL_CONFLICTS=${TOTAL_CONFLICTS:-0}" >> $GITHUB_ENV
|
||||
|
||||
# Extract failed files list
|
||||
if grep -q "FAILED_FILES<<EOF" resolution_output.txt; then
|
||||
echo "HAS_UNRESOLVED=true" >> $GITHUB_ENV
|
||||
echo "FAILED_FILES<<EOF" >> $GITHUB_ENV
|
||||
sed -n '/FAILED_FILES<<EOF/,/^EOF$/p' resolution_output.txt | grep "^- " >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
else
|
||||
echo "HAS_UNRESOLVED=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
# Show resolution summary
|
||||
cat resolution_output.txt
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user