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

Authentication issues when renewing GH_TOKEN #141

Closed
Sam54000 opened this issue Aug 15, 2023 · 4 comments
Closed

Authentication issues when renewing GH_TOKEN #141

Sam54000 opened this issue Aug 15, 2023 · 4 comments

Comments

@Sam54000
Copy link

Hi,
I have been using the workflow for a while now. As my GH_TOKEN expires I renewed it as usual (and I took care to tick the correct permissions). But since recently the workflow throw a 403 error telling me that the access is denied:
522 CRITICAL 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/repos/contents#create-or-update-file-contents"}

Do you have any idea of what it would be?

Here is the log

[2023-08-15 20:19:50] ln. 505 DEBUG    Initialize WakaReadme
[2023-08-15 20:19:50] ln. 163 DEBUG    Validating input variables
[2023-08-15 20:19:50] ln. 229 DEBUG    Input validation complete

[2023-08-15 20:19:50] ln. 465 DEBUG    Connecting to GitHub
[2023-08-15 20:19:50] ln. 471 DEBUG    Decoding readme contents

[2023-08-15 20:19:50] ln. 349 DEBUG    Pulling WakaTime stats from all time
[2023-08-15 20:19:50] ln. 364 DEBUG    API response #1: 200 • OK
[2023-08-15 20:19:50] ln. 368 DEBUG    Fetched WakaTime statistics

[2023-08-15 20:19:50] ln. 280 DEBUG    Making contents
Total Time: 519 hrs 2 mins
[2023-08-15 20:19:50] ln. 262 DEBUG    Generating graph for 'Python'

[2023-08-15 20:19:50] ln. 270 DEBUG    'Python' graph generated
Python          454 hrs 53 mins ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣀⣀⣀   87.64 %
[2023-08-15 20:19:50] ln. 262 DEBUG    Generating graph for 'Vim Script'
Vim Script      42 hrs 11 mins  ⣿⣿⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀   08.13 %
[2023-08-15 20:19:50] ln. 270 DEBUG    'Vim Script' graph generated
Other           11 hrs 45 mins  ⣦⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀   02.26 %
[2023-08-15 20:19:50] ln. 262 DEBUG    Generating graph for 'Other'

[2023-08-15 20:19:50] ln. 270 DEBUG    'Other' graph generated
[2023-08-15 20:19:50] ln. 337 DEBUG    Contents were made

[2023-08-15 20:19:50] ln. 478 DEBUG    WakaReadme stats has changed
[2023-08-15 20:19:51] ln. 522 CRITICAL 403 {"message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/repos/contents#create-or-update-file-contents"}

Here is the yml file:

name: Waka Readme

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

jobs:
  update-readme:
    name: WakaReadme DevMetrics
    runs-on: ubuntu-latest
    steps:
      - uses: athul/waka-readme@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          API_BASE_URL: https://wakatime.com/api
          REPOSITORY: Sam54000/Sam54000
          SHOW_TITLE: false
          BLOCKS: ⣀⣄⣤⣦⣶⣷⣿
          TIME_RANGE: all_time
          SHOW_TIME: true
          SHOW_MASKED_TIME: true
          LANG_COUNT: 3
          COMMIT_MESSAGE: Updated waka-readme graph with new metrics
          TARGET_BRANCH: main
          TARGET_PATH: README.md
          COMMITTER_NAME: GitHubActionBot
          COMMITTER_EMAIL: action-bot@github.org
          AUTHOR_NAME: Sam54000
          AUTHOR_EMAIL: <my_email>

Thanks

@yozachar
Copy link
Collaborator

Hi @Sam54000, refer #114 (comment). You really do not need GH_TOKEN on profile readme.


But if you want to use it, your token access summary should be like so.

image

@Sam54000
Copy link
Author

Hi @joe733 I tried without the GH_TOKEN but somewhat it wasn't working either. I tried the Fine-grained token instead of the Classic one and now it works.
Thanks!

@yozachar
Copy link
Collaborator

Without GH_TOKEN you need to set read-write permission in Code and automation → Actions → General → Workflow permissions section of your profile repository settings. Anyway glad it worked, thanks for using waka-readme!

@Leeon-K
Copy link

Leeon-K commented Oct 8, 2023

Without GH_TOKEN you need to set read-write permission in Code and automation → Actions → General → Workflow permissions section of your profile repository settings. Anyway glad it worked, thanks for using waka-readme!

Thank you, it works!!

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

3 participants