Skip to content

Commit 646835f

Browse files
authored
[ci] Properly format commit message (facebook#32668)
Using the github variable for the commit message replaces the variable inline. If the commit message contains quotes or other characters that need to be escaped, this breaks the workflow. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32668). * facebook#32669 * __->__ facebook#32668
1 parent c2a1961 commit 646835f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/runtime_commit_artifacts.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ jobs:
252252
git config --global user.email "${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}"
253253
git config --global user.name "${{ github.triggering_actor }}"
254254
255-
git commit -m "${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
256-
257-
DiffTrain 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"
255+
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"
258256
- name: Push changes to branch
259257
if: inputs.dry_run == false && (inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true')
260258
run: git push
@@ -419,9 +417,7 @@ jobs:
419417
git config --global user.email "${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}"
420418
git config --global user.name "${{ github.triggering_actor }}"
421419
422-
git commit -m "${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
423-
424-
DiffTrain 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"
420+
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"
425421
- name: Push changes to branch
426422
if: inputs.dry_run == false && (inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true')
427423
run: git push

0 commit comments

Comments
 (0)