File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,18 +147,21 @@ jobs:
147147 - name : Update composer dependencies
148148 id : composer-update
149149 run : |
150- {
151- echo "commit_body<<EOF"
152- composer update --no-scripts 2>&1 | tee composer_output.txt | grep -Pzo 'Lock file operations.*(\n|.)*Writing lock file' | tail -n +2 | head -n -1 | sed -r 's/ +?- ([^ ]+) //g'
153- COMPOSERSTATUS=${PIPESTATUS[0]}
154- echo "EOF"
155- if [ $COMPOSERSTATUS -ne 0 ]; then
156- cat composer_output.txt
157- rm composer_output.txt
158- exit $COMPOSERSTATUS;
159- fi
160- rm composer_output.txt
161- } >> $GITHUB_OUTPUT
150+ echo "Running composer update..."
151+ output=$(composer update --no-scripts 2>&1)
152+ composer_exit_code=$?
153+
154+ # If composer update fails, exit with a non-zero status
155+ if [ $composer_exit_code -ne 0 ]; then
156+ echo "Composer update failed"
157+ echo "$output"
158+ exit $composer_exit_code
159+ fi
160+
161+ # Process output if successful
162+ echo "commit_body<<EOF" >> $GITHUB_OUTPUT
163+ echo "$output" | grep -Pzo 'Lock file operations.*(\n|.)*Writing lock file' | tail -n +2 | head -n -1 | sed -r 's/ +?- ([^ ]+) //g' >> $GITHUB_OUTPUT
164+ echo "EOF" >> $GITHUB_OUTPUT
162165
163166 - name : " Run composer normalize"
164167 id : composer-normalize
You can’t perform that action at this time.
0 commit comments