Repository: facebook/react
Pull request: [ci] Properly format commit message take 2


We need to use the commit message from `main`, not the builds branch


Changed files:
filename: .github/workflows/runtime_commit_artifacts.yml
patch: @@ -246,13 +246,19 @@ jobs:
         run: |
           echo ":"
           git status -u
+      - name: Check commit message
+        if: inputs.dry_run
+        run: |
+          git fetch origin --quiet
+          git show ${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }} --no-patch --pretty=format:"%B"
       - name: Commit changes to branch
         if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
         run: |
           git config --global user.email "${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}"
           git config --global user.name "${{ github.triggering_actor }}"
 
-          git commit -m "$(git show --no-patch --pretty=format:'%B%n%nDiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha}})')" || echo "No changes to commit"
+          git fetch origin --quiet
+          git commit -m "$(git show ${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }} --no-patch --pretty=format:'%B%n%nDiffTrain build for [${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha}})')" || echo "No changes to commit"
       - name: Push changes to branch
         if: inputs.dry_run == false && (inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true')
         run: git push
@@ -411,13 +417,19 @@ jobs:
         run: |
           git add .
           git status
+      - name: Check commit message
+        if: inputs.dry_run
+        run: |
+          git fetch origin --quiet
+          git show ${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }} --no-patch --pretty=format:"%B"
       - name: Commit changes to branch
         if: inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
         run: |
           git config --global user.email "${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}"
           git config --global user.name "${{ github.triggering_actor }}"
 
-          git commit -m "$(git show --no-patch --pretty=format:'%B%n%nDiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha}})')" || echo "No changes to commit"
+          git fetch origin --quiet
+          git commit -m "$(git show ${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }} --no-patch --pretty=format:'%B%n%nDiffTrain build for [${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha}})')" || echo "No changes to commit"
       - name: Push changes to branch
         if: inputs.dry_run == false && (inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true')
         run: git push