Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github token gives bad credentials #627

Open
razzeee opened this issue Sep 7, 2023 · 15 comments
Open

Github token gives bad credentials #627

razzeee opened this issue Sep 7, 2023 · 15 comments

Comments

@razzeee
Copy link
Collaborator

razzeee commented Sep 7, 2023

Hey @rectifyer can you check the github tokens used for https://github.com/trakt/script.trakt/actions/runs/6113115321/job/16591958743

They might be outdated/expired

@rectifyer
Copy link
Contributor

Any idea what I need to do? I see GH_TOKEN in the repository security settings, but it hasn't changed that I'm aware of.

@razzeee
Copy link
Collaborator Author

razzeee commented Sep 9, 2023

I'm not sure, but aren't tokens expiring? Maybe just create a new one and set it?

@razzeee
Copy link
Collaborator Author

razzeee commented Nov 25, 2023

@rectifyer

@razzeee
Copy link
Collaborator Author

razzeee commented Feb 12, 2024

@rectifyer

@rectifyer
Copy link
Contributor

@razzeee I updated the EMAIL and GH_TOKEN with newly generated values.

@razzeee
Copy link
Collaborator Author

razzeee commented Feb 13, 2024

Thank you

@razzeee razzeee closed this as completed Feb 13, 2024
@razzeee razzeee reopened this Mar 3, 2024
@razzeee
Copy link
Collaborator Author

razzeee commented Mar 3, 2024

@rectifyer can you check if that token has public_repo like https://github.com/xbmc/action-kodi-addon-submitter?tab=readme-ov-file#gh_token suggests?

@rectifyer
Copy link
Contributor

image

I believe it has the correct permissions. However, this refers to GITHUB_TOKEN instead of GH_TOKEN.

@razzeee
Copy link
Collaborator Author

razzeee commented Mar 3, 2024

Yeah, the name mismatching like that would be a problem

@rectifyer
Copy link
Contributor

@razzeee I believe the GITHUB_TOKEN is automatically created, so you should be able to just use it.

https://dev.to/github/the-githubtoken-in-github-actions-how-it-works-change-permissions-customizations-3cgp

@razzeee
Copy link
Collaborator Author

razzeee commented Mar 4, 2024

@rectifyer
Copy link
Contributor

rectifyer commented Mar 5, 2024

@razzeee I've never actually used actions before. I re-ran it with debug logging and the 403 seems related to POSTing to one of the xbmc repos.

addon-submitter - INFO: Getting addon.xml file content
urllib3.connectionpool - DEBUG: Starting new HTTPS connection (1): api.github.com:443
urllib3.connectionpool - DEBUG: [https://api.github.com:443](https://api.github.com/) "GET /repos/razzeee/repo-scripts?type=all HTTP/1.1" 200 None
addon-submitter - INFO: Creating addon branch "matrix"...
addon-submitter - INFO: Addon branch "matrix" created successfully.
addon-submitter - INFO: Checking pull request...
urllib3.connectionpool - DEBUG: Starting new HTTPS connection (1): api.github.com:443
urllib3.connectionpool - DEBUG: [https://api.github.com:443](https://api.github.com/) "GET /repos/xbmc/repo-scripts/pulls?head=razzeee%3Ascript.trakt%40matrix&base=matrix HTTP/1.1" 200 2
addon-submitter - INFO: Submitting pull request...
urllib3.connectionpool - DEBUG: Starting new HTTPS connection (1): api.github.com:443
urllib3.connectionpool - DEBUG: [https://api.github.com:443](https://api.github.com/) "POST /repos/xbmc/repo-scripts/pulls HTTP/1.1" 403 None
addon-submitter - DEBUG: Pull request URL: https://api.github.com/repos/xbmc/repo-scripts/pulls

Here is what I ended up doing:

  1. Created a new classic token (https://github.com/settings/tokens/new) called XMBC_REPO with no expiration.
  2. I added a new XMBC_REPO action variable under the script.trakt project.
  3. Updated the submit.yml file to use XBMC_REPO
  4. Created a new tag v3.6.8
  5. Action ran and created pull request [script.trakt@matrix] 3.6.1 xbmc/repo-scripts#2593

Hopefully that did what it is supposed to do. I'm not quite sure if it will just work when you tag a new release, or if you need to create your own token and I need to use that in the script.trakt repo.

@razzeee
Copy link
Collaborator Author

razzeee commented Mar 6, 2024

Thanks, glad it finally worked

@razzeee
Copy link
Collaborator Author

razzeee commented May 25, 2024

@razzeee
Copy link
Collaborator Author

razzeee commented Jun 1, 2024

Looking at it again, it start to feel like GITHUB_TOKEN vs GH_TOKEN was done deliberately. And we shouldn't have changed it. Probably used to have a fixed user/token and not a changing one based on who releases.

We probably need to fork https://github.com/xbmc/repo-scripts/ with the trakt org for the script to work. https://github.com/trakt/script.trakt/actions/runs/9330076737/job/25683262621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants