Skip to content

Commit

Permalink
Update building-a-cli-with-a-github-app.md (github#30938)
Browse files Browse the repository at this point in the history
  • Loading branch information
margaret-tucker authored Jan 4, 2024
1 parent fdf1bf7 commit 5526439
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)."
Expand Down

0 comments on commit 5526439

Please sign in to comment.