regression with v7 doing github.rest.pulls.create
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- github-actions, typescript
Piste de recherche
Compare the v6 and v7 behavior around github.rest.pulls.create and the plugin-rest-endpoint-methods.js pulls/create documentation linked in the report; begin by reproducing the supplied workflow call and inspecting the request payload. Done means the v7 call includes owner and creates the pull request without the reported error.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
Upgrading from v6 to v7, we can no longer run github.rest.pulls.create. If the log messages are to be believed, we are not sending the required parameter owner.
This does not appear to be an instance of the same problem in #448.
To Reproduce
Steps to reproduce the behavior:
- Create a v6 script like this one that tries to create a pull request using
await github.rest.pulls.create({ title: 'chore: my PR title', owner: 'repo_owner_name', repo: 'repo_name', head: 'head_path/' + context.sha, base: 'master', })``` - Verify the action works.
- Convert the action to v7
- See error below.
Expected behavior
The PR should be created without error.
Actual behavior
We get the log message below. If the report of the sent request (at the bottom of this log message) is to be believed, we are sending the request without the required parameter owner, even though it is included in the defined script call.
body: '{"title":"chore: bump credentials-themes version","head":"edx-deployment/credentials-themes/30f0084470295dda47262c3f74617d70b2df8e77","base":"master"}',
Run actions/github-script@v7
with:
github-token: ***
script: // Create credentials PR from version-updating branch above
const createResponse = await github.rest.pulls.create({
title: 'chore: bump credentials-themes version',
owner: 'edx',
repo: 'credentials',
head: 'edx-deployment/credentials-themes/' + context.sha,
base: 'master',
})
// Get the PR that relates to the tagged commit
const getRelatedPrResponse = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: 'edx',
repo: 'credentials-themes',
commit_sha: process.env.GITHUB_SHA
})
const prNumber = getRelatedPrResponse.data.length > 0 ? getRelatedPrResponse.data[0].number : undefined;
if (prNumber === undefined) {
console.log("No matching PR number for commit")
exit(1)
}
// Comment on the original PR with a link to the credentials PR
github.rest.issues.createComment({
owner: 'edx',
repo: 'credentials-themes',
issue_number: prNumber,
body: `A PR has been created in the credentials repo to release this new version. Please review it here: ${createResponse.data.html_url}`,
});
debug: false
user-agent: actions/github-script
result-encoding: json
retries: 0
retry-exempt-status-codes: 400,401,403,404,422
env:
pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.8.18/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
RequestError [HttpError]: fetch failed
at /home/runner/work/_actions/actions/github-script/v7/dist/index.js:9561:11
at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35424:16), <anonymous>:4:24)
at async main (/home/runner/work/_actions/actions/github-script/v7/dist/index.js:35522:20) {
status: 500,
request: {
method: 'POST',
url: 'https://api.github.com/repos/edx/credentials/pulls',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'actions/github-script octokit-core.js/5.0.1 Node.js/20.8.1 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{"title":"chore: bump credentials-themes version","head":"edx-deployment/credentials-themes/30f0084470295dda47262c3f74617d70b2df8e77","base":"master"}',
request: {
agent: [Agent],
fetch: [Function: proxyFetch],
hook: [Function: bound bound register]
}
}
}
Error: Unhandled error: HttpError: fetch failed
Additional context
Reverting fixed the problem.
I tried to see what could have changed in plugin-rest-endpoint-methods.js that might have made the original call lose one (and only one) argument, but because plugin-rest-endpoint-methods.js is several versions ahead there was just such a massive diff and I didn't see anything obvious.
I apologize if I missed an obvious part of the upgrade documentation.
- Langage dominant
- TypeScript
- Étoiles
- 5k
- Forks
- 586
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de actions/github-script
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
actions/github-script#728 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
actions/github-script#727 · 1 réaction ·
-
{ Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
actions/github-script#724 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
actions/github-script#723 · 1 commentaire ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
actions/github-script#714 · 1 commentaire · 4 réactions ·
Toutes les issues de actions/github-script
Issues similaires
-
blocklist removal
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
pastelsky/bundlephobia#1122 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100