rajbos / rajbos/github-fork-updater

Fail the run if the token that is given does not have access

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
19
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Currently the run just continues to execute, with nothing done. But it does not fail and just shows "Succeeded" as output.
Fail the run!

2s
Run $updateResult = (.\updater.ps[1](https://github.com/xxxx/github-fork-updater/actions/runs/4677275043/jobs/8284587467#step:5:1) -orgName xxxx -userName "xxx" -PAT *** -issuesRepository xxxxx/github-fork-updater )
Running a check on all repositories inside of organization [xxxx] with user [xxx] and a PAT that has length [40]
Error calling api at [https://api.github.com/orgs/xxxx/repos?per_page=[10](https://github.com/xxxx/github-fork-updater/actions/runs/4677275043/jobs/8284587467#step:5:11)0]:
  StatusCode: Unauthorized
  RateLimit-Limit: 60
  RateLimit-Remaining: 59
  RateLimit-Reset: 168[12](https://github.com/xxxx/github-fork-updater/actions/runs/4677275043/jobs/8284587467#step:5:13)988[16](https://github.com/xxxx/github-fork-updater/actions/runs/4677275043/jobs/8284587467#step:5:17)
  RateLimit-Used: 1
{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
@{message=Bad credentials; documentation_url=[https://docs.github.com/rest}](https://docs.github.com/rest%7D)
Found [0] repositories in [xxxx]
Found [0] forks with available updates

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in updater.ps1 at the GitHub API error handling shown in the run log, especially the Unauthorized/Bad credentials response. Make the run report failure instead of continuing with zero repositories, then rerun the action with an invalid token and confirm it no longer shows Succeeded.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, powershell
Domain
api, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.