diff --git a/.gitea/workflows/maintenance.yaml b/.gitea/workflows/maintenance.yaml index ecc57d1..35393cd 100644 --- a/.gitea/workflows/maintenance.yaml +++ b/.gitea/workflows/maintenance.yaml @@ -23,37 +23,37 @@ jobs: branch: update/pre-commit-hooks push_options: --force create_branch: true - - run: | - curl -X 'POST' \ - 'https://git.horstenkamp.eu/api/v1/repos/Philipp/gitea-act-create-pr/pulls' \ - -H 'accept: application/json' \ - -H 'authorization: Basic cGhpbGlwcDphc2ZqSMKnMzg5SjhmSzM=' \ - -H 'Content-Type: application/json' \ - -d '{ - "base": "main", - "body": "string", - "head": "update/pre-commit-hooks", - "title": "Some title" - }' - - name: Make a curl request - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - curl -X 'POST' \ - 'https://git.horstenkamp.eu/api/v1/repos/Philipp/gitea-act-create-pr/pulls' \ - -H 'accept: application/json' \ - -H "Authorization: token ${GITHUB_TOKEN}" \ - -H 'Content-Type: application/json' \ - -d '{ - "base": "main", - "body": "string", - "head": "update/pre-commit-hooks", - "title": "Some title" - }' + # - run: | + # curl -X 'POST' \ + # 'https://git.horstenkamp.eu/api/v1/repos/Philipp/gitea-act-create-pr/pulls' \ + # -H 'accept: application/json' \ + # -H 'authorization: Basic cGhpbGlwcDphc2ZqSMKnMzg5SjhmSzM=' \ + # -H 'Content-Type: application/json' \ + # -d '{ + # "base": "main", + # "body": "string", + # "head": "update/pre-commit-hooks", + # "title": "Some title" + # }' + # - name: Make a curl request + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # curl -X 'POST' \ + # 'https://git.horstenkamp.eu/api/v1/repos/Philipp/gitea-act-create-pr/pulls' \ + # -H 'accept: application/json' \ + # -H "Authorization: token ${GITHUB_TOKEN}" \ + # -H 'Content-Type: application/json' \ + # -d '{ + # "base": "main", + # "body": "string", + # "head": "update/pre-commit-hooks", + # "title": "Some title" + # }' - name: My PR action uses: ./ with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_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 fed262c..6948149 100644 --- a/action.yml +++ b/action.yml @@ -1,8 +1,8 @@ name: Create PR if not exists description: Creates a pull request for a branch if it does not already exist inputs: - github_token: - description: GitHub token for authentication + token: + description: Token for authentication. Github Token will not work. required: false branch: description: Branch for which to create the PR diff --git a/index.js b/index.js index 28f1bdf..b62e267 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ async function getAndPostPullRequests() { const labelsInput = core.getInput("labels"); const dueDate = core.getInput("due_date"); const milestone = core.getInput("milestone"); - const githubToken = core.getInput("github_token"); + const token = core.getInput("token"); let branch = core.getInput("branch"); // Construct the URL for the requests @@ -25,10 +25,10 @@ async function getAndPostPullRequests() { // Headers with Authorization const headers = { - Authorization: `token ${githubToken}`, + Authorization: `token ${token}`, "Content-Type": "application/json", }; - core.info(`token ${githubToken}`); + core.info(`token ${token}`); // Logic for current branch if (!branch) { const ref = process.env.GITHUB_REF;