I am trying to retrieve my projects information from my classic project board via the Github API. This is on my own repository that is cloned from another repo, but not forked. The Project board is also copied.
name: retieve project board info
on:
issues:
types: [edited]
jobs:
Log-Trigger:
runs-on: ubuntu-latest
steps:
- run: echo " The job was triggered"
check_column_and_perform_action:
runs-on: ubuntu-latest
steps:
- name: retrieve project board
id: project board
run: |
PROJECT_BOARD=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.ICE_BOX_TESTER }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/projects/1)
echo "::set-output name=project_board::${PROJECT_BOARD}"
But I keep getting back the response "Must have admin rights to Repository"
I checked my tokens scope- repo, workflow, and projects are checked. I have even tried checking off ALL scopes.
I know the token works since I've used it on postman to retrieve my repositories, but it also does not let me pull the project on there either.
Also tried changing "Authorization: Bearer ${{ secrets.ICE_BOX_TESTER }}" to "Authorization: token ${{ secrets.ICE_BOX_TESTER }}"
The request sent by using the response from @Dayanada D R gives back information regarding projects in that repo.
I used that information to then get the value from the key ID. This ID is what should be used in the endpoint "https://api.github.com/projects/PROJECT_ID". This gave me back a 200 response.
Contrary to other information I've found online, the PROJECT_ID is not the last number listed on the project's URL. ex: "github.com/JpadillaCoding/hfla-Website-clone/projects/1"