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

Add 'x-access-token:' to support GITHUB_TOKEN #692

Merged

Conversation

kenji-miyake
Copy link
Contributor

Resolves #691

As @christophebedard has checked, added x-access-token.
#691 (comment)

Tested in my repository. (Changed to public after testing in private.)
kenji-miyake/action-ros-ci-test-private#4

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
@kenji-miyake kenji-miyake requested a review from a team as a code owner July 30, 2021 02:27
@kenji-miyake kenji-miyake requested review from christophebedard and lucashan and removed request for a team July 30, 2021 02:27
@christophebedard christophebedard added the enhancement New feature or request label Jul 30, 2021
@codecov
Copy link

codecov bot commented Jul 30, 2021

Codecov Report

Merging #692 (bbcc2a7) into master (d5882d1) will decrease coverage by 0.82%.
The diff coverage is n/a.

❗ Current head bbcc2a7 differs from pull request most recent head 5a2b7c9. Consider uploading reports for the commit 5a2b7c9 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #692      +/-   ##
==========================================
- Coverage   49.38%   48.55%   -0.83%     
==========================================
  Files           2        2              
  Lines         243      243              
  Branches       53       53              
==========================================
- Hits          120      118       -2     
- Misses        123      125       +2     
Impacted Files Coverage Δ
src/action-ros-ci.ts 41.58% <ø> (-0.94%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5882d1...5a2b7c9. Read the comment docs.

@christophebedard
Copy link
Member

I tested this on my side as well. Since there are a few different possible configurations/setups, here is a table:

private repo? private dependencies? works before this PR, with GITHUB_TOKEN works with this PR, with GITHUB_TOKEN works before/now, with a PAT/REPO_TOKEN
☑️ ☑️ ☑️
☑️ ☑️ ☑️

Does that look okay @kenji-miyake?

I think we should change the "private repos" section of the README here https://github.com/ros-tooling/action-ros-ci#Use-with-private-repos to:

action-ros-ci needs a token to be able to clone private repositories.
If the only private repository your workflow needs is the one against which it runs, using the default GITHUB_TOKEN will work.
However, if your workflow also clones other private repositories (e.g., repositories included in repos files provided through vcs-repo-file-url), you will need to generate a personal access token (PAT) with the "repo" scope and add it to your repo's [secrets][creating-encrypted-secrets].
For example, if this secret is called REPO_TOKEN:

steps:
  # ...
  - uses: ros-tooling/action-ros-ci@v0.2
    with:
      package-name: my_package
      # If there are no private dependencies, no need to create a PAT or add a secret
      import-token: ${{ secrets.GITHUB_TOKEN }}
      # If there are private dependencies (e.g., in a file provided through vcs-repo-file-url), a PAT is required
      import-token: ${{ secrets.REPO_TOKEN }}
      # ...

@kenji-miyake
Copy link
Contributor Author

@christophebedard Yes, it looks good. Should I change the README?

@christophebedard
Copy link
Member

@christophebedard Yes, it looks good. Should I change the README?

please! 😄 you can just copy-paste what I wrote above if you want

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
@kenji-miyake
Copy link
Contributor Author

@christophebedard I'm sorry to be late, done!

@christophebedard
Copy link
Member

@christophebedard I'm sorry to be late, done!

no worries!

Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

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

Looks good to me! The private repo test was skipped because this PR is coming from a fork, but we both tested it and it works.

Thank you for the contribution!

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

Successfully merging this pull request may close these issues.

GITHUB_TOKEN doesn't work for private repositories that don't have private dependencies
2 participants