Created a first draft of this action. #14
@ -53,7 +53,7 @@ jobs:
|
||||
- name: My PR action
|
||||
uses: ./
|
||||
with:
|
||||
github_token: ${{ secrets.REPO_TOKEN }}
|
||||
token: ${{ secrets.REPO_TOKEN }}
|
||||
branch: update/pre-commit-hooks
|
||||
title: My PR Title
|
||||
body: My PR Body
|
||||
|
@ -3,7 +3,7 @@ description: Creates a pull request for a branch if it does not already exist
|
||||
inputs:
|
||||
token:
|
||||
description: Token for authentication. Github Token will not work.
|
||||
required: false
|
||||
required: true
|
||||
branch:
|
||||
description: Branch for which to create the PR
|
||||
required: true
|
||||
|
4
index.js
4
index.js
@ -20,6 +20,10 @@ async function getAndPostPullRequests() {
|
||||
const token = core.getInput("token");
|
||||
let branch = core.getInput("branch");
|
||||
|
||||
if (!token || token.trim() === "") {
|
||||
throw new Error("No token provided. Please provide a valid token.");
|
||||
}
|
||||
|
||||
// Construct the URL for the requests
|
||||
const url = `${baseUrl}/api/v1/repos/${owner}/${repo}/pulls`;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user