Skip to content

Commit 7aa1583

Browse files
fix: apply copilot fixes
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 06ddb1b commit 7aa1583

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

scripts/create-app-jwt.sh

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
#!/usr/bin/env bash
2-
1+
#!/bin/bash
2+
3+
# -----------------------------------------------------------------------------
4+
# Script to create a JWT (JSON Web Token) signed with a private RSA key.
5+
#
6+
# Usage:
7+
# ./create-app-jwt.sh <client_id> <private_key_file>
8+
#
9+
# Arguments:
10+
# <client_id> The client ID to use as the JWT issuer (iss).
11+
# <private_key_file> Path to the PEM-encoded RSA private key file.
12+
#
13+
# Example:
14+
# ./create-app-jwt.sh my-client-id /path/to/private-key.pem
15+
#
16+
# The script outputs the generated JWT to stdout.
17+
# -----------------------------------------------------------------------------
318
set -o pipefail
19+
20+
# Input validation for required parameters
21+
if [ -z "$1" ] || [ -z "$2" ]; then
22+
echo "Error: Missing required parameters." >&2
23+
echo "Usage: $0 <client_id> <path_to_private_key_pem>" >&2
24+
exit 1
25+
fi
26+
427
client_id=$1 # Client ID as first argument
528

6-
pem=$( cat $2 ) # file path of the private key as second argument
29+
pem=$( cat "$2" ) # file path of the private key as second argument
730

831
now=$(date +%s)
932
iat=$((${now} - 60)) # Issues 60 seconds in the past

scripts/github-app-manifest-flow/create-github-app-from-manifest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,5 @@ echo "Important: Save the client_secret, webhook_secret, and pem values securely
142142
echo "The pem field contains the full RSA private key for the app."
143143
echo "These credentials cannot be retrieved again through the API."
144144
echo ""
145-
echo " Private key automatically saved to: $PEM_FILENAME"
145+
echo "🔑 Private key automatically saved to: $PEM_FILENAME"
146146
echo "💡 You can use this file for GitHub App authentication and JWT generation."

0 commit comments

Comments
 (0)