Skip to content

Commit

Permalink
fix github actions ?
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-agenta committed Nov 15, 2024
1 parent 0ec8ab7 commit b671872
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/actions/check-app-accessibility/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
log-file:
description: 'The path to the log file containing the serve output'
required: true
api-key:
description: 'The API key for accessing the app'
required: false
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -31,9 +34,13 @@ runs:
echo "$APP_URL is accessible without API key"
exit 0
elif [ "$status_code" -eq 401 ]; then
if [ -z "${{ inputs.api-key }}" ]; then
echo "Error: $APP_URL is not accessible without API key"
sleep 10 # Wait before retrying
fi
status_code=$( \
curl --max-time 60 --write-out %{http_code} --silent --output /dev/null --verbose \
-H "Authorization: Bearer ${{ secrets.AGENTA_API_KEY }}" \
-H "Authorization: Bearer ${{ inputs.api-key }}" \
$APP_URL)
echo "Attempt $i: Status code: $status_code"
if [ "$status_code" -eq 200 ]; then
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cli-commands-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
uses: ./.github/actions/check-app-accessibility
with:
log-file: serve_output.log
api-key: ${{ secrets.AGENTA_API_KEY }}
continue-on-error: false

- name: Run agenta variant serve with overwrite
Expand Down

0 comments on commit b671872

Please sign in to comment.