Skip to content

GitHub Actions Workflows: remove Personal Access Token usage - #2387

Closed
jayaddison wants to merge 2 commits into
tj-actions:mainfrom
jayaddison:pr-2305-followup/prefer-github-token-over-personal-access-token
Closed

jayaddison wants to merge 2 commits into
tj-actions:mainfrom
jayaddison:pr-2305-followup/prefer-github-token-over-personal-access-token

Conversation

with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm taking a second look at this pull request, and I don't have a good reason why I removed the persist-credentials: false line. If we can keep it in place, then I think we should do that (minimisation of credentials and their exposure).

@jayaddison

Copy link
Copy Markdown
Author

NB: I have tested that this GitHub Actions workflow job is able to commit codestyle-lint-fixup changes after removal of the Personal Access Token, and did that by using a pull request I opened including the commits from this branch on a fork of this repository at: https://github.com/jayaddison/eslint-changed-files/pull/1

@jayaddison

Copy link
Copy Markdown
Author

@jackton1 ping?

@jayaddison

Copy link
Copy Markdown
Author

@jackton1 repinging - please could the personal access token usage here also be removed?

@jayaddison

Copy link
Copy Markdown
Author

@jackton1 ping? the tj-actions.online domain does not seem to resolve, so I sent you an email to your ymail.com address instead to ask about this.

@jayaddison

Copy link
Copy Markdown
Author

@jackton1 hello - there's a GitHub PAT token configured in this repository - please could you take a look?

@jayaddison

Copy link
Copy Markdown
Author

I'm going to guess that for some reason my notifications didn't get through - maybe a notification configuration issue -- or alternatively that my initial PR as-opened at commit cffde71 seemed wrong/flawed and was, initially, untested.

I'm going to close this and delete my branch since it doesn't seem likely to be accepted in the nearish future. The contents of this branch can, however, be retrieved from GitHub, and I'd be happy for anyone else to re-offer the same fix using these commits, which I believe consists of adding permissions: write and replacing PAT_TOKEN with GITHUB_TOKEN.

To do that with this repository configured as the upstream remote in git:

$ git fetch upstream pull/2387/head:your-preferred-branch-name-here

Also documented at: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally?tool=cli#modifying-an-inactive-pull-request-locally

@jayaddison jayaddison closed this Feb 13, 2026
@jayaddison
jayaddison deleted the pr-2305-followup/prefer-github-token-over-personal-access-token branch February 13, 2026 16:49
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

Successfully merging this pull request may close these issues.

1 participant