diff --git a/.github/workflows/cmd.yml b/.github/workflows/cmd.yml index 7289f38b59a7..a28f8d523f70 100644 --- a/.github/workflows/cmd.yml +++ b/.github/workflows/cmd.yml @@ -443,7 +443,8 @@ jobs: uses: actions/download-artifact@v4 with: name: command-diff - + path: command-diff + # needs to be able to trigger CI, as default token does not retrigger - uses: actions/create-github-app-token@v1 id: generate_token @@ -453,6 +454,7 @@ jobs: - name: Apply & Commit changes run: | + ls -lsa . ls -lsaR command-diff git config --global --add safe.directory $GITHUB_WORKSPACE @@ -525,9 +527,12 @@ jobs: }) finish: - needs: [before-cmd, after-cmd, cmd] + needs: [get-pr-info, before-cmd, after-cmd, cmd] if: ${{ always() }} runs-on: ubuntu-latest + env: + CMD_OUTPUT: "${{ needs.cmd.outputs.cmd_output }}" + CMD: ${{ needs.get-pr-info.outputs.CMD }} steps: - name: Comment PR (Failure) if: ${{ needs.cmd.result == 'failure' || needs.after-cmd.result == 'failure' }} @@ -539,9 +544,11 @@ jobs: let cmdOutput = process.env.CMD_OUTPUT; let cmd = process.env.CMD; - let cmdOutputCollapsed = cmdOutput.trim() !== '' - ? `
\n\nCommand output:\n\n${cmdOutput}\n\n
` - : ''; + if (cmdOutput) { + let cmdOutputCollapsed = cmdOutput.trim() !== '' + ? `
\n\nCommand output:\n\n${cmdOutput}\n\n
` + : ''; + } github.rest.issues.createComment({ issue_number: context.issue.number,