Skip to content

Commit

Permalink
fix rest endpoint in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
michelengelen committed Nov 5, 2024
1 parent 9a2d64b commit 15d01e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/scripts/prs/checkTargetBranchLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ module.exports = async ({ core, context, github }) => {
const repo = context.repo.repo;
const pullNumber = context.issue.number;

const pr = await github.rest.pull_request.get({
const { data: pr } = await github.rest.pulls.get({
owner,
repo,
pull_number: pullNumber,
});

core.info(`>>> PR fetched: ${pr.id}`);
core.info(`>>> PR fetched: ${pr.number}`);

const targetLabels = pr.labels
.map((label) => label.name)
?.map((label) => label.name)
.filter((label) => vBranchRegex.test(label));

const comesFromVersionBranch = vBranchRegex.test(pr.head_ref);
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scripts/prs/detectTargetBranch.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ module.exports = async ({ core, context, github }) => {
const repo = context.repo.repo;
const pullNumber = context.issue.number;

const pr = await github.rest.pulls.get({
const { data: pr } = await github.rest.pulls.get({
owner,
repo,
pull_number: pullNumber,
});

core.info(`>>> PR fetched: ${pr.id}`);
core.info(`>>> PR fetched: ${pr.number}`);

const targetLabels = pr.labels
.map((label) => label.name)
?.map((label) => label.name)
.filter((label) => vBranchRegex.test(label));

if (targetLabels.length === 0) {
Expand Down

0 comments on commit 15d01e4

Please sign in to comment.