Created a first draft of this action. #14

Merged
Philipp merged 68 commits from draft into main 2023-11-19 23:21:49 +01:00
296 changed files with 37485 additions and 0 deletions
Showing only changes of commit 9365d681df - Show all commits

View File

@ -56,7 +56,7 @@ jobs:
token: ${{ secrets.REPO_TOKEN }}
branch: update/pre-commit-hooks
title: My PR Title
body: My PR Body
# body: My PR Body
assignees: Philipp
reviewers: Philipp
labels: chore

View File

@ -16,6 +16,7 @@ inputs:
body:
description: Body of the pull request
required: false
default: Some default tile!
assignees:
description: Comma-separated list of assignees for the pull request
required: false

View File

@ -13,6 +13,7 @@ async function getAndPostPullRequests() {
const title = core.getInput("title");
const body = core.getInput("body") || "";
const assigneesInput = core.getInput("assignees");
const reviewersInput = core.getIDToken("reviewers");
const dueDate = core.getInput("due_date");
const milestone = core.getInput("milestone");
const token = core.getInput("token");
@ -31,7 +32,6 @@ async function getAndPostPullRequests() {
accept: "application/json",
};
core.info(`token ${token}`);
// Logic for current branch
// Prepare POST data
const postData = {
@ -39,15 +39,15 @@ async function getAndPostPullRequests() {
body: body,
head: branch,
base: base_branch,
assignees: assigneesInput ? assigneesInput.split(",") : [], // Changed to be omitted if empty
due_date: dueDate || undefined, // Changed to be omitted if empty
milestone: milestone ? parseInt(milestone, 10) : 0, // Changed to be omitted if empty
assignees: assigneesInput ? assigneesInput.split(",") : [],
reviewers: reviewersInput ? reviewersInput.split(",") : [],
due_date: dueDate || undefined,
milestone: milestone ? parseInt(milestone, 10) : 0,
};
// Perform the POST request
core.info(`URL for POST request: ${url}`);
core.info(`POST data being sent: ${JSON.stringify(postData, null, 2)}`);
core.info(`URL with token: ${url}?access_token=${token}`);
const postResponse = await fetch(`${url}?access_token=${token}`, {
method: "POST",
headers,