Skip to content

Commit 06e3c4b

Browse files
committed
ci(blocked-pr): use gh issue comment --create-if-none --edit-last with app token, not composit action
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
1 parent 187728c commit 06e3c4b

File tree

2 files changed

+14
-167
lines changed

2 files changed

+14
-167
lines changed

.github/actions/create-comment/action.yml

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

.github/workflows/blocked-prs.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,14 @@ jobs:
198198
done < <(jq -c '.[]' <<< "$BLOCKING_DATA")
199199
200200
- name: Context Comment
201-
id: blocked_comment
201+
id: generate-comment
202202
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0
203203
continue-on-error: true
204204
env:
205205
BLOCKING_DATA: ${{ steps.blocking_data.outputs.data }}
206206
run: |
207207
COMMENT_PATH="$(pwd)/temp_comment_file.txt"
208-
touch "$COMMENT_PATH"
209-
echo "" > "$COMMENT_PATH"
208+
echo '<h3> PR Dependencies :pushpin:</h3>' > "$COMMENT_PATH"
210209
pr_head_label=$(jq -r '.prHeadLabel' <<< "$JOB_DATA")
211210
while read -r pr_data ; do
212211
base_pr=$(jq -r '.number' <<< "$pr_data")
@@ -218,17 +217,20 @@ jobs:
218217
type=$(jq -r '.type' <<< "$pr_data")
219218
echo " - $type #$base_pr $status [(compare)]($compare_url)" >> "$COMMENT_PATH"
220219
done < <(jq -c '.[]' <<< "$BLOCKING_DATA")
221-
echo "file_path=${COMMENT_PATH}" >> "$GITHUB_OUTPUT"
220+
221+
echo 'body<<EOF' >> "$GITHUB_OUTPUT"
222+
cat "${COMMENT_PATH}" >> "$GITHUB_OUTPUT"
223+
echo 'EOF' >> "$GITHUB_OUTPUT"
222224
223225
- name: 💬 PR Comment
224226
if: fromJSON(steps.pr_ids.outputs.prs).numBlocking > 0
225227
continue-on-error: true
226-
uses: ./.github/actions/create-comment
227-
with:
228-
comment: "<h3> PR Dependencies :pushpin:</h3>"
229-
comment_path: ${{ steps.blocked_comment.outputs.file_path }}
230-
comment_id: "block_pr_dependencies"
231-
issue_number: ${{ env.PR_NUMBER }}
232-
repository: ${{ github.repository }}
233-
gh_token: ${{ steps.generate-token.outputs.token }}
228+
env:
229+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
230+
COMMENT_BODY: ${{ steps.generate-comment.outputs.body }}
231+
run: |
232+
gh -R ${{ github.repository }} issue comment "$PR_NUMBER" \
233+
--body "$COMMENT_BODY" \
234+
--create-if-none \
235+
--edit-last
234236

0 commit comments

Comments
 (0)