Skip to content

Commit 5bcc2f9

Browse files
committed
fix: filter outputs to exempt share secrets between jobs
1 parent dc44e45 commit 5bcc2f9

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

Diff for: .github/workflows/stale.yml

+34-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
cancel-in-progress: false
2626
# export variables used by reporter job
2727
outputs:
28-
staled-issues: ${{ steps.staler.outputs.staled-issues-prs }}
29-
closed-issues: ${{ steps.staler.outputs.closed-issues-prs }}
28+
staled-issues: ${{ steps.stale.outputs.staled-issues-prs }}
29+
closed-issues: ${{ steps.stale.outputs.closed-issues-prs }}
3030
# enable write access rights to allow comment and labeling by bot
3131
permissions:
3232
issues: write
@@ -55,6 +55,21 @@ jobs:
5555
days-before-pr-stale: -1
5656
days-before-pr-close: -1
5757

58+
- name: Set outputs
59+
## Removing private properties from each JSON object.
60+
## TODO: Remove this ugly fix for actions/stale#806
61+
id: stale
62+
run: |
63+
echo $STALED \
64+
| jq --compact-output --raw-output 'del(.[] | .[to_entries[] | .key | select(startswith("_"))])' \
65+
| sed -e 's/^/::set-output name=staled-issues-prs::/'
66+
echo $CLOSED \
67+
| jq --compact-output --raw-output 'del(.[] | .[to_entries[] | .key | select(startswith("_"))])' \
68+
| sed -e 's/^/::set-output name=closed-issues-prs::/'
69+
env:
70+
STALED: ${{ steps.staler.outputs.staled-issues-prs }}
71+
CLOSED: ${{ steps.staler.outputs.closed-issues-prs }}
72+
5873

5974
process-prs:
6075
name: Process Pull Requests
@@ -64,8 +79,8 @@ jobs:
6479
cancel-in-progress: false
6580
# export variables used by reporter job
6681
outputs:
67-
staled-prs: ${{ steps.staler.outputs.staled-issues-prs }}
68-
closed-prs: ${{ steps.staler.outputs.closed-issues-prs }}
82+
staled-prs: ${{ steps.stale.outputs.staled-issues-prs }}
83+
closed-prs: ${{ steps.stale.outputs.closed-issues-prs }}
6984
# enable write access rights to allow comment and labeling by bot
7085
permissions:
7186
pull-requests: write
@@ -95,6 +110,21 @@ jobs:
95110
days-before-issue-stale: -1
96111
days-before-issue-close: -1
97112

113+
- name: Set outputs
114+
## Removing private properties from each JSON object.
115+
## TODO: Remove this ugly fix for actions/stale#806
116+
id: stale
117+
run: |
118+
echo $STALED \
119+
| jq --compact-output --raw-output 'del(.[] | .[to_entries[] | .key | select(startswith("_"))])' \
120+
| sed -e 's/^/::set-output name=staled-issues-prs::/'
121+
echo $CLOSED \
122+
| jq --compact-output --raw-output 'del(.[] | .[to_entries[] | .key | select(startswith("_"))])' \
123+
| sed -e 's/^/::set-output name=closed-issues-prs::/'
124+
env:
125+
STALED: ${{ steps.staler.outputs.staled-issues-prs }}
126+
CLOSED: ${{ steps.staler.outputs.closed-issues-prs }}
127+
98128

99129
reporter:
100130
name: GitHub reporter

0 commit comments

Comments
 (0)