Skip to content

Commit e9c0d5a

Browse files
authored
ci(dependabot-pr-body): use webpage PR URL instead of API URL (nim-works#1600)
## Summary `gh` CLI tool can only handle URL to a PR page, not the PR's API URL. ## Details The `url` element in `pull_request` payload links to the API URL for the associated PR. It appears that `gh` CLI will not interpret this as an usable URL and will attempt to obtain the repository from the current directory, which is not available since we don't perform cloning, breaking the automation. This PR swaps the URL over to the `html_url` element, which points to the same link one will find in a browser when a PR page is opened. Local testing confirmed that this URL would work with a non-git working directory.
1 parent d3c5744 commit e9c0d5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/dependabot-pr-body.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ jobs:
2222
gh pr view "$PR_URL" --json body --jq '"---\n\n" + .body' \
2323
| gh pr edit "$PR_URL" --body-file -
2424
env:
25-
PR_URL: ${{ github.event.pull_request.url }}
25+
PR_URL: ${{ github.event.pull_request.html_url }}
2626
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)