Get file contents
Read a file from a repository as text, or save it to a local file.
Command in the GitHub toolkit · id ooa.github/get_file · 7 inputs (4 required), 3 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Endpoint address | String | No | https://api.github.com | API address. Keep the default for github.com; for GitHub Enterprise Server use https://github.yourcompany.com/api/v3. |
| Token | Credential | Yes | Personal access token or app token from the vault, with access to the repository. Or leave it empty and choose a connection that signs in, which gets and renews the token. | |
| Owner | String | Yes | User or organization that owns the repository, e.g. acme-corp. | |
| Repo | String | Yes | Repository name without the owner, e.g. billing-service. | |
| Path | String | Yes | Path of the file inside the repository. | |
| Ref | String | No | Branch, tag or commit to read from. Empty means the default branch. | |
| Save to | File | No | Local file to save the contents to, e.g. downloads/rates.json. |
Outputs
| Output | Type | What it is |
|---|---|---|
| text | String | File contents as UTF-8 text (empty when saved to a file). |
| sha | String | Version id of the file; pass it to Create or update file to change it safely. |
| size | Number | Size in bytes. |