Skip to content

Commit

Permalink
Fix script syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
jlantz committed Oct 2, 2024
1 parent ee9c825 commit 4f0aa87
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,40 +53,40 @@ jobs:
fi
done
- name: Run CumulusCI automerge task
env:
GITHUB_TOKEN: ${{ secrets.github-token }}
GITHUB_APP_ID: ${{ secrets.github-app-id }}
GITHUB_APP_KEY: ${{ secrets.github-app-key }}
run: |
set +e # Allow the script to continue if the cci task fails
if [ "${{ inputs.merge_target }}" = "main" ]; then
- name: Run CumulusCI automerge task
env:
GITHUB_TOKEN: ${{ secrets.github-token }}
GITHUB_APP_ID: ${{ secrets.github-app-id }}
GITHUB_APP_KEY: ${{ secrets.github-app-key }}
run: |
set +e # Allow the script to continue if the cci task fails
if [ "${{ inputs.merge_target }}" = "main" ]; then
cci task run github_automerge_main | tee merge_output.log
elif [ "${{ inputs.merge_target }}" = "feature" ]; then
elif [ "${{ inputs.merge_target }}" = "feature" ]; then
cci task run github_automerge_feature | tee merge_output.log
else
else
echo "Invalid merge target specified"
exit 1
fi
CCI_EXIT_CODE=$?
set -e # Re-enable exit on error
fi
CCI_EXIT_CODE=$?
set -e # Re-enable exit on error
echo "## Merge Operation Summary" >> $GITHUB_STEP_SUMMARY
echo "Target: ${{ inputs.merge_target }}" >> $GITHUB_STEP_SUMMARY
echo "Branch: ${{ inputs.branch_name }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
grep -E "Merged|Skipping branch|Merge conflict" merge_output.log | sed 's/^//' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "## Merge Operation Summary" >> $GITHUB_STEP_SUMMARY
echo "Target: ${{ inputs.merge_target }}" >> $GITHUB_STEP_SUMMARY
echo "Branch: ${{ inputs.branch_name }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Results" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
grep -E "Merged|Skipping branch|Merge conflict" merge_output.log | sed 's/^//' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# Check if any merges were performed
if ! grep -q -E "Merged|Skipping branch|Merge conflict" merge_output.log; then
# Check if any merges were performed
if ! grep -q -E "Merged|Skipping branch|Merge conflict" merge_output.log; then
echo "No merge operations were performed." >> $GITHUB_STEP_SUMMARY
fi
fi
# Check if there was an error and run cci error info if so
if [ $CCI_EXIT_CODE -ne 0 ]; then
# Check if there was an error and run cci error info if so
if [ $CCI_EXIT_CODE -ne 0 ]; then
echo "### Error Details" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cci error info >> $GITHUB_STEP_SUMMARY 2>&1
Expand All @@ -95,4 +95,4 @@ jobs:
echo "CumulusCI task failed. Error details:"
cci error info
exit $CCI_EXIT_CODE
fi
fi

0 comments on commit 4f0aa87

Please sign in to comment.