Skip to content

Commit d2b81b8

Browse files
committed
chore(ci): actual fix for output mapping
1 parent 60e1836 commit d2b81b8

File tree

3 files changed

+15
-45
lines changed

3 files changed

+15
-45
lines changed

.github/scripts/export_pr_details.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/label_pr_on_title.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,11 @@ jobs:
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@v3
25-
- name: Troubleshoot outputs
26-
env:
27-
NEEDS: ${{ toJSON(needs) }}
28-
run: echo "$NEEDS"
2925
- name: "Label PR based on title"
3026
uses: actions/github-script@v6
3127
env:
3228
PR_NUMBER: ${{ needs.get_pr_details.outputs.prNumber }}
3329
PR_TITLE: ${{ needs.get_pr_details.outputs.prTitle }}
34-
OUTPUT_DEBUG: "${{ needs.get_pr_details.outputs.result }}"
3530
with:
3631
github-token: ${{ secrets.GITHUB_TOKEN }}
3732
# This safely runs in our base repo, not on fork

.github/workflows/reusable_export_pr_details.yml

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,29 +58,23 @@ jobs:
5858
# NodeJS standard library doesn't provide ZIP capabilities; use system `unzip` command instead
5959
- name: "Unzip PR artifact"
6060
run: unzip pr.zip
61-
- id: prNumber
61+
# NOTE: We need separate steps for each mapped output and respective IDs
62+
# otherwise the parent caller won't see them regardless on how outputs are set.
63+
- name: "Export Pull Request Number"
64+
id: prNumber
6265
run: echo ::set-output name=prNumber::$(jq -c '.number' ${FILENAME})
63-
- id: prTitle
66+
- name: "Export Pull Request Title"
67+
id: prTitle
6468
run: echo ::set-output name=prTitle::$(jq -c '.pull_request.title' ${FILENAME})
65-
- id: prBody
69+
- name: "Export Pull Request Body"
70+
id: prBody
6671
run: echo ::set-output name=prBody::$(jq -c '.pull_request.body' ${FILENAME})
67-
- id: prAuthor
72+
- name: "Export Pull Request Author"
73+
id: prAuthor
6874
run: echo ::set-output name=prAuthor::$(jq -c '.pull_request.user.login' ${FILENAME})
69-
- id: prAction
70-
run: echo ::set-output name=prAction::$(jq -c '.pull_request.action' ${FILENAME})
71-
- id: prIsMerged
75+
- name: "Export Pull Request Action"
76+
id: prAction
77+
run: echo ::set-output name=prAction::$(jq -c '.action' ${FILENAME})
78+
- name: "Export Pull Request Merged status"
79+
id: prIsMerged
7280
run: echo ::set-output name=prIsMerged::$(jq -c '.pull_request.merged' ${FILENAME})
73-
74-
# run: |
75-
# echo ::set-output name=prTitle::$(jq -c '.pull_request.title' ${FILE})
76-
# echo ::set-output name=prBody::$(jq -c '.pull_request.body' ${FILE})
77-
# echo ::set-output name=prAuthor::$(jq -c '.pull_request.user.login' ${FILE})
78-
# echo ::set-output name=prAction::$(jq -c '.pull_request.action' ${FILE})
79-
# echo ::set-output name=prIsMerged::$(jq -c '.pull_request.merged' ${FILE})
80-
# - name: "Export PR details"
81-
# uses: actions/github-script@v6
82-
# with:
83-
# github-token: ${{ secrets.token }}
84-
# script: |
85-
# const script = require('.github/scripts/export_pr_details.js')
86-
# await script({github, context, core})

0 commit comments

Comments
 (0)