diff --git a/.gitea/workflows/maintenance.yaml b/.gitea/workflows/maintenance.yaml index fce23e5..130dcf9 100644 --- a/.gitea/workflows/maintenance.yaml +++ b/.gitea/workflows/maintenance.yaml @@ -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 diff --git a/action.yml b/action.yml index 6948149..260d44a 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/index.js b/index.js index 4427260..5102451 100644 --- a/index.js +++ b/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`;