From aa0e06605cb7ab23911385af26ac9ec2ecd7680c Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Tue, 24 Sep 2024 12:27:22 -0400 Subject: [PATCH] [ci] Fix missing user name 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. Instead, use the top level triggering_actor property Test plan: https://github.com/facebook/react/actions/runs/11017512571 completes ghstack-source-id: 90f24e048289d10d467302129bfe6c4c2a09ea20 Pull Request resolved: https://github.com/facebook/react/pull/31045 --- .github/workflows/runtime_commit_artifacts.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/runtime_commit_artifacts.yml b/.github/workflows/runtime_commit_artifacts.yml index 9710fa4eed9ff..2ae8332e2c849 100644 --- a/.github/workflows/runtime_commit_artifacts.yml +++ b/.github/workflows/runtime_commit_artifacts.yml @@ -245,12 +245,12 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: | - ${{ github.event.workflow_run.head_commit.message }} + ${{ github.event.workflow_run.head_commit.message || 'No commit message' }} - DiffTrain build for [${{ github.event.workflow_run.head_sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }}) + DiffTrain build for [${{ github.sha }}](https://github.com/facebook/react/commit/${{ github.sha }}) branch: builds/facebook-www - commit_user_name: ${{ github.event.workflow_run.triggering_actor.login }} - commit_user_email: ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run.triggering_actor.login) }} + commit_user_name: ${{ github.triggering_actor }} + commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }} create_branch: true commit_fbsource_artifacts: @@ -412,10 +412,10 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: | - ${{ github.event.workflow_run.head_commit.message }} + ${{ github.event.workflow_run.head_commit.message || 'No commit message' }} - DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }}. + DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.sha }}. branch: builds/facebook-fbsource - commit_user_name: ${{ github.event.workflow_run.triggering_actor.login }} - commit_user_email: ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run.triggering_actor.login) }} + commit_user_name: ${{ github.triggering_actor }} + commit_user_email: ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }} create_branch: true