Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parser tests updater again #12538

Merged
merged 1 commit into from Dec 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/update-parser-tests.yml
Expand Up @@ -57,27 +57,35 @@ jobs:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const base = process.env.GITHUB_REF.replace("refs/heads/", "");
const { data: prs } = await github.pulls.list({
const requestParam = {
owner: context.repo.owner,
repo: context.repo.repo,
head: "update-test262-parser",
base: base
});
head: context.repo.owner + ":update-test262-parser",
Copy link
Contributor Author

@JLHwung JLHwung Dec 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish octokit would validate them 🤷

base: base,
state: "open"
};
const result = await github.pulls.list(requestParam);
console.log("Open PR request: ", requestParam);
console.log("Open PR response: ", result);
const prs = result.data;
if (prs.length === 0) {
const { data: pr } = await github.pulls.create({
const requestParam = {
owner: context.repo.owner,
repo: context.repo.repo,
head: "update-test262-parser",
base: base,
maintainer_can_modify: true,
title: "Update test262",
body: "Update test262 to [${{ steps.test262.outputs.sha1 }}](https://github.com/tc39/test262/commit/${{ steps.test262.outputs.sha1 }}).",
});
};
const result = await github.pulls.create(requestParam);
console.log("Create PR request: ", requestParam)
console.log("Create PR response: ", result);

github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
issue_number: result.data.number,
labels: ["area: test262", "repo automation 🤖"]
})
}