Skip to content

Commit

Permalink
fix: extract PR body from correct variable (#172)
Browse files Browse the repository at this point in the history
# Description

Extracts the PR body from the correct variable.
  • Loading branch information
kayman-mk authored Jan 9, 2025
1 parent 1e821e4 commit 221368a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/default_slash_ops_command_ready_callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ jobs:
with:
script: |
// get the PR text and make sure that all items are checked
const prText = context.payload.pull_request.body;
const pr = await github.rest.pulls.get({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.client_payload.pull_request.number,
});
const prText = pr.data.body;
prText.split('\n').forEach(line => {
if (line.startsWith('- [ ]')) {
Expand All @@ -39,10 +44,10 @@ jobs:
replace(/<!--[\s\S]*?-->/g, '');
// update the PR text
github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
await github.rest.pulls.update({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.client_payload.pull_request.number,
body: cleanPrText,
});
Expand Down

0 comments on commit 221368a

Please sign in to comment.