1
0
mirror of synced 2026-02-01 03:01:50 -05:00

Merge pull request #48558 from github/repo-sync

Repo sync
This commit is contained in:
docs-bot
2024-01-04 14:55:45 -05:00
committed by GitHub

View File

@@ -172,7 +172,7 @@ These steps lead you through building a CLI and using device flow to get a user
1. Optionally, check your progress:
`app_cli.rb` now looks like this. The order of the functions don't matter as long as the `main` function call is at the end of the file.
`app_cli.rb` now looks like this. The order of the functions doesn't matter as long as the `main` function call is at the end of the file.
```ruby copy
#!/usr/bin/env ruby
@@ -218,7 +218,7 @@ The `login` command will run the device flow to get a user access token. For mor
CLIENT_ID="YOUR_CLIENT_ID"
```
1. Add the following `parse_response` function to `app_cli.rb`. This function parses a response from the {% data variables.product.company_short %} REST API. When the response status is `200 OK` or `201 Created`, the function returns the parsed response body. Otherwise, the function prints the response and body an exits the program.
1. Add the following `parse_response` function to `app_cli.rb`. This function parses a response from the {% data variables.product.company_short %} REST API. When the response status is `200 OK` or `201 Created`, the function returns the parsed response body. Otherwise, the function prints the response and body and exits the program.
```ruby copy
def parse_response(response)
@@ -356,7 +356,7 @@ The `login` command will run the device flow to get a user access token. For mor
1. Optionally, check your progress:
`app_cli.rb` now looks something like this, where `YOUR_CLIENT_ID` is the client ID of your app. The order of the functions don't matter as long as the `main` function call is at the end of the file.
`app_cli.rb` now looks something like this, where `YOUR_CLIENT_ID` is the client ID of your app. The order of the functions doesn't matter as long as the `main` function call is at the end of the file.
```ruby copy
#!/usr/bin/env ruby
@@ -749,7 +749,7 @@ This tutorial demonstrated how to write a CLI that uses the device flow to gener
This tutorial generates a user access token and saves it in a local file. You should never commit this file or publicize the token.
Depending on your device, you may choose different way to store the token. You should check the best practices for storing tokens on your device.
Depending on your device, you may choose different ways to store the token. You should check the best practices for storing tokens on your device.
For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/best-practices-for-creating-a-github-app)."