[ci] Fix missing values during manual workflow dispatch
It seems like the github.event.workflow_run payload is only populated for non manual runs of the workflow, so this would crash the manual dispatch Test plan: https://github.com/facebook/react/actions/runs/11017512571 completes ghstack-source-id: fce02b17f85ac4762de0561764785882e767c872 Pull Request resolved: https://github.com/facebook/react/pull/31045
Lauren Tan committed
Sep 26, 2024 at 09:55 UTC
64be7b4dccb7b19404b94afdfab955e1c73796df
1 file changed
+11
-11
.github/workflows/runtime_commit_artifacts.yml
+11
-11
@@ -82,7 +82,7 @@ jobs:
82
working-directory: scripts/release
83
- name: Download artifacts for base revision
84
run: |
85
- GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.event.workflow_run.head_sha }}
85
+ GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.sha }}
86
- name: Display structure of build
87
run: ls -R build
88
- name: Strip @license from eslint plugin and react-refresh
@@ -145,9 +145,9 @@ jobs:
145
ls -R ./compiled-rn
146
- name: Add REVISION files
147
run: |
148
- echo ${{ github.event.workflow_run.head_sha }} >> ./compiled/facebook-www/REVISION
148
+ echo ${{ github.sha }} >> ./compiled/facebook-www/REVISION
149
cp ./compiled/facebook-www/REVISION ./compiled/facebook-www/REVISION_TRANSFORMS
150
- echo ${{ github.event.workflow_run.head_sha}} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
150
+ echo ${{ github.sha}} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
151
- name: "Get current version string"
152
id: get_current_version
153
run: |
@@ -245,12 +245,12 @@ jobs:
245
uses: stefanzweifel/git-auto-commit-action@v4
246
with:
247
commit_message: |
248
- ${{ github.event.workflow_run.head_commit.message }}
248
+ ${{ github.event.workflow_run.head_commit.message || 'No commit message' }}
249
250
- DiffTrain build for [${{ github.event.workflow_run.head_sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }})
250
+ DiffTrain build for [${{ github.sha }}](https://github.com/facebook/react/commit/${{ github.sha }})
251
branch: builds/facebook-www
252
- commit_user_name: ${{ github.event.workflow_run.triggering_actor.login }}
253
- commit_user_email: ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run.triggering_actor.login) }}
252
+ commit_user_name: ${{ github.triggering_actor }}
253
+ commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
254
create_branch: true
255
256
commit_fbsource_artifacts:
@@ -412,10 +412,10 @@ jobs:
412
uses: stefanzweifel/git-auto-commit-action@v4
413
with:
414
commit_message: |
415
- ${{ github.event.workflow_run.head_commit.message }}
415
+ ${{ github.event.workflow_run.head_commit.message || 'No commit message' }}
416
417
- DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }}.
417
+ DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.sha }}.
418
branch: builds/facebook-fbsource
419
- commit_user_name: ${{ github.event.workflow_run.triggering_actor.login }}
420
- commit_user_email: ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run.triggering_actor.login) }}
419
+ commit_user_name: ${{ github.triggering_actor }}
420
+ commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
421
create_branch: true