Skip to content

Commit

Permalink
fix: Use Docker Hub to fetch tags instead of GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
tczekajlo committed Oct 6, 2020
1 parent 54078a1 commit 108afda
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ runs:
- name: Set the Rasa SDK version
shell: bash
run: |
DOCKERHUB_TAGS_URL="https://registry.hub.docker.com/v2/repositories/rasa/rasa-sdk/tags?page_size=10000"
# Get the latest version
if [[ "${{ inputs.rasa_sdk_version }}" == "latest" ]]; then
LATEST_RASA_SDK_VERSION=$(curl --silent "https://api.github.com/repos/RasaHQ/rasa-sdk/tags" | jq -r .[].name | grep -v refs | sort -Vr | head -n1)
echo "action_state=yellow"
LATEST_RASA_SDK_VERSION=$(curl -s ${DOCKERHUB_TAGS_URL} | jq -r '.results[].name' | grep -vE 'refs|aws|latest' | sort -Vr | head -n1)
echo "RASA_SDK_VERSION=${LATEST_RASA_SDK_VERSION}" >> $GITHUB_ENV
else
# Validate Rasa SDK version
CHECK_VERSION=$(curl --silent "https://api.github.com/repos/RasaHQ/rasa-sdk/tags" | jq -r '.[] | select(.name=="${{ inputs.rasa_sdk_version }}") | .name')
CHECK_VERSION=$(curl --silent ${DOCKERHUB_TAGS_URL} | jq -r '.results[] | select(.name=="${{ inputs.rasa_sdk_version }}") | .name')
if [[ "$CHECK_VERSION" != "${{ inputs.rasa_sdk_version }}" ]]; then
echo "::error::Rasa SDK in ${{ inputs.rasa_sdk_version }} version doesn't exist. Check if the given Rasa SDK version is valid, https://github.com/RasaHQ/rasa-sdk/tags" && exit 1
echo "::error::Rasa SDK in ${{ inputs.rasa_sdk_version }} version doesn't exist. Check if the given Rasa SDK version is valid, https://hub.docker.com/r/rasa/rasa-sdk/tags" && exit 1
fi
echo "RASA_SDK_VERSION=${{ inputs.rasa_sdk_version }}" >> $GITHUB_ENV
fi
Expand Down

0 comments on commit 108afda

Please sign in to comment.