Added more rights
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 33s

This commit is contained in:
Philipp Horstenkamp 2023-11-19 19:32:43 +01:00
parent 15f375f907
commit 8bfaf7cd5b
Signed by: Philipp
GPG Key ID: DD53EAC36AFB61B4
2 changed files with 4 additions and 6 deletions

View File

@ -9,6 +9,9 @@ jobs:
auto-update:
name: pre-commit Autoupdate
runs-on: pi64
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

View File

@ -1,10 +1,6 @@
const core = require("@actions/core");
const _ = require("underscore");
function Sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}
async function getAndPostPullRequests() {
try {
core.info("Starting the action...");
@ -54,7 +50,7 @@ async function getAndPostPullRequests() {
assignees: assigneesInput ? assigneesInput.split(",") : 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
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
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(`POST data being sent: ${JSON.stringify(postData, null, 2)}`);
await Sleep(50000);
const postResponse = await fetch(url, {
method: "POST",
headers,