Skip to content

Commit dd5de1f

Browse files
author
Charles Li
committed
Add some log to debug AddLabel workflow
1 parent 172d0f1 commit dd5de1f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/AddLabel.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ jobs:
3131
runs-on: ubuntu-latest
3232

3333
steps:
34-
- uses: actions/github-script@v7
34+
- name: Print Triggering Workflow Name
35+
run: echo "The workflow that triggered this was ${{ github.event.workflow_run.name }}"
36+
37+
- name: Add Pull Request Label
38+
uses: actions/github-script@v7
3539
with:
3640
script: |
3741
const owner = "google"
@@ -40,8 +44,9 @@ jobs:
4044
if (context.payload.pull_request !== undefined) {
4145
pull_number = context.payload.pull_request.number
4246
} else if (context.payload.workflow_run !== undefined) {
47+
workflow_name = context.payload.workflow_run.name
4348
if (context.payload.workflow_run.pull_requests.length === 0) {
44-
console.log("This workflow is NOT running within a PR's context")
49+
console.log("This workflow ${workflow_name} is NOT running within a PR's context")
4550
process.exit()
4651
}
4752
console.log(context.payload.workflow_run.pull_requests)

0 commit comments

Comments
 (0)