Skip to content

Usage of github-token input is not clearly documented#312

@aliphys

Description

@aliphys

Describe the problem

GitHub Runner does not have access to private repositories, even when the github-token field is set.

To reproduce

As part of a compile-examples workflow, I have a private repository that I want to include in the libraries field.

 - name: Compile examples uses: arduino/compile-sketches@v1 with: github-token: ${{secrets.GITHUB_TOKEN }} fqbn: ${{matrix.board.fqbn }} platforms: ${{matrix.board.platforms }} libraries: | - source-path: ./ - name: Arduino_PF1550 - name: Arduino_LowPowerPortentaH7 - source-url: https://github.com/arduino-libraries/Arduino_LowPowerPortentaC33.git - source-url: https://github.com/bcmi-labs/Arduino_LowPowerNiclaVision.git sketch-paths: | ${{env.UNIVERSAL_SKETCH_PATHS }} ${{matrix.board.additional-sketch-paths }} enable-deltas-report: true sketches-report-path: ${{env.SKETCHES_REPORTS_PATH }} 

As stated in the README section the token is provided to the GitHub API: github-token: ${{secrets.GITHUB_TOKEN }}

### `github-token`
GitHub access token used to get information from the GitHub API. Only needed for private repositories with [`enable-deltas-report`](#enable-deltas-report) set to `true`. It will be convenient to use [`${{secrets.GITHUB_TOKEN }}`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token).
**Default**: `""`

However, the internal library is not accessible to the GitHub Runner according to the logs.

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git clone -v --depth=1 --recurse-submodules -- https://github.com/bcmi-labs/Arduino_LowPowerNiclaVision.git /tmp/compilesketches-205fms1c/install_from_repository-iu_c__ge stderr: 'Cloning into '/tmp/compilesketches-205fms1c/install_from_repository-iu_c__ge'... fatal: could not read Username for 'https://github.com/': No such device or address ' Error: Process completed with exit code 1. 

Expected behavior

If I enter a private GitHub repository for the source-url key, and I have access to it, then the GitHub Runner should also have access to it and load the library.

'arduino/compile-sketches' version

arduino/compile-sketches@v1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest version
  • My report contains all necessary details

Metadata

Metadata

Assignees

Labels

topic: documentationRelated to documentation for the projecttype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions