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

External link checker: Add an HTTP header for the auth for GitHub #1392

Merged
merged 3 commits into from
May 15, 2024

Conversation

arnaucasau
Copy link
Collaborator

Part of #823

This PR adds a new HTTP header to the external link checker to set the auth for GitHub when we are checking GitHub links. The new header is only used for GitHub links following what we do in the closed-source repo.

In order to be able to get the environment variable from typescript with process.env.GITHUB_TOKEN, we need to define it in the workflows. In the case of running the script locally, the token could be undefined.

@qiskit-bot
Copy link
Contributor

Thanks for contributing to Qiskit documentation!

Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌

@arnaucasau
Copy link
Collaborator Author

arnaucasau commented May 15, 2024

You can find an example of this method in this run where I'm just checking one file with GitHub links and using a console.log before adding the new header to show how we can access the token.

@arnaucasau arnaucasau marked this pull request as draft May 15, 2024 16:38
@arnaucasau arnaucasau marked this pull request as ready for review May 15, 2024 16:47
@qiskit-bot
Copy link
Contributor

Thanks for contributing to Qiskit documentation!

Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

scripts/lib/links/ExternalLink.ts Outdated Show resolved Hide resolved
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
@arnaucasau arnaucasau added this pull request to the merge queue May 15, 2024
Merged via the queue into Qiskit:main with commit e138414 May 15, 2024
2 checks passed
@arnaucasau arnaucasau deleted the AC/link-checker-github branch May 15, 2024 17:11
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
…skit#1392)

Part of Qiskit#823

This PR adds a new HTTP header to the external link checker to set the
auth for GitHub when we are checking GitHub links. The new header is
only used for GitHub links following what we do in the closed-source
repo.

In order to be able to get the environment variable from typescript with
`process.env.GITHUB_TOKEN`, we need to define it in the workflows. In
the case of running the script locally, the token could be undefined.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants