Added more rights
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 33s
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 33s
This commit is contained in:
parent
15f375f907
commit
8bfaf7cd5b
@ -9,6 +9,9 @@ jobs:
|
|||||||
auto-update:
|
auto-update:
|
||||||
name: pre-commit Autoupdate
|
name: pre-commit Autoupdate
|
||||||
runs-on: pi64
|
runs-on: pi64
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
|
7
index.js
7
index.js
@ -1,10 +1,6 @@
|
|||||||
const core = require("@actions/core");
|
const core = require("@actions/core");
|
||||||
const _ = require("underscore");
|
const _ = require("underscore");
|
||||||
|
|
||||||
function Sleep(milliseconds) {
|
|
||||||
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getAndPostPullRequests() {
|
async function getAndPostPullRequests() {
|
||||||
try {
|
try {
|
||||||
core.info("Starting the action...");
|
core.info("Starting the action...");
|
||||||
@ -54,7 +50,7 @@ async function getAndPostPullRequests() {
|
|||||||
assignees: assigneesInput ? assigneesInput.split(",") : undefined, // Changed to be omitted if empty
|
assignees: assigneesInput ? assigneesInput.split(",") : undefined, // Changed to be omitted if empty
|
||||||
labels: labelsInput ? labelsInput.split(",").map(Number) : undefined, // Changed to be omitted if empty
|
labels: labelsInput ? labelsInput.split(",").map(Number) : undefined, // Changed to be omitted if empty
|
||||||
due_date: dueDate || undefined, // Changed to be omitted if empty
|
due_date: dueDate || undefined, // Changed to be omitted if empty
|
||||||
milestone: milestone ? parseInt(milestone, 10) : undefined, // Changed to be omitted if empty
|
milestone: milestone ? parseInt(milestone, 10) : 0, // Changed to be omitted if empty
|
||||||
};
|
};
|
||||||
// Perform the GET request to check if a similar PR exists
|
// Perform the GET request to check if a similar PR exists
|
||||||
const getResponse = await fetch(`${url}?state=open&head=${branch}`, {
|
const getResponse = await fetch(`${url}?state=open&head=${branch}`, {
|
||||||
@ -78,7 +74,6 @@ async function getAndPostPullRequests() {
|
|||||||
|
|
||||||
core.info(`URL for POST request: ${url}`);
|
core.info(`URL for POST request: ${url}`);
|
||||||
core.info(`POST data being sent: ${JSON.stringify(postData, null, 2)}`);
|
core.info(`POST data being sent: ${JSON.stringify(postData, null, 2)}`);
|
||||||
await Sleep(50000);
|
|
||||||
const postResponse = await fetch(url, {
|
const postResponse = await fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers,
|
headers,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user