Skip to content

Commit

Permalink
refactor: rename requestOptions.body to requestOptions.data as it is …
Browse files Browse the repository at this point in the history
…expected by octokit.request
  • Loading branch information
gr2m committed Jan 26, 2021
1 parent 207f58e commit 1715c5c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ async function main() {

// workaround for https://github.com/octokit/request-action/issues/71
// un-encode "repo" in /repos/{repo} URL when "repo" parameter is set to ${{ github.repository }}
const options = octokit.request.endpoint(route, parameters);
const { url, body, ...options } = octokit.request.endpoint(
route,
parameters
);
const requestOptions = {
...options,
data: body,
url: options.url.replace(
/\/repos\/([^/]+)/,
(_, match) => "/repos/" + decodeURIComponent(match)
Expand Down

0 comments on commit 1715c5c

Please sign in to comment.