@@ -30,6 +30,9 @@ inputs:
3030 description : ' File type for Windows (setup.exe, installer.exe, remote.zip)'
3131 required : false
3232 default : ' setup.exe'
33+ github_token :
34+ description : ' GitHub token to make authenticated API requests'
35+ required : false
3336
3437outputs :
3538 version :
@@ -52,10 +55,16 @@ runs:
5255 INPUT_VERSION="${{ inputs.version_input }}"
5356 ARCHITECTURE="${{ inputs.architecture }}"
5457 FILE_TYPE="${{ inputs.file_type }}"
58+ GITHUB_TOKEN="${{ inputs.github_token }}"
5559
5660 echo "Input version: $INPUT_VERSION"
5761 echo "Architecture: $ARCHITECTURE"
5862 echo "File type: $FILE_TYPE"
63+ if [ -n "$GITHUB_TOKEN" ]; then
64+ echo "GitHub Token: ***"
65+ else
66+ echo "GitHub Token: not provided"
67+ fi
5968
6069 # Input validation
6170 if [ -z "$INPUT_VERSION" ]; then
@@ -71,12 +80,14 @@ runs:
7180 echo "Error: jq is required but not installed"
7281 exit 1
7382 fi
74-
83+
7584 # Fetch latest release with error handling
76- API_RESPONSE=$(curl -s https://api.github.com/repos/containers/podman/releases/latest)
77- if [ $? -ne 0 ]; then
78- echo "Error: Failed to fetch data from GitHub API"
79- exit 1
85+ if [ -n "$GITHUB_TOKEN" ]; then
86+ echo "Using GITHUB_TOKEN for authenticated API request."
87+ API_RESPONSE=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/containers/podman/releases/latest)
88+ else
89+ echo "Warning: GITHUB_TOKEN is not set. API requests may be subject to stricter rate limits."
90+ API_RESPONSE=$(curl -s https://api.github.com/repos/containers/podman/releases/latest)
8091 fi
8192
8293 # Check for API errors (rate limiting, etc.)
0 commit comments