diff options
author | Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> | 2024-04-09 20:04:00 +0200 |
---|---|---|
committer | Shane McDonald <me@shanemcd.com> | 2024-04-10 17:26:42 +0200 |
commit | 8db3ffe719fc84533b70fd37789bbef285a7c95a (patch) | |
tree | 260967bcf3ce855085f169471170b3927a97775f /.github | |
parent | Clean the postgres 15 volume (#15083) (diff) | |
download | awx-8db3ffe719fc84533b70fd37789bbef285a7c95a.tar.xz awx-8db3ffe719fc84533b70fd37789bbef285a7c95a.zip |
Check galaxy collection with and without redirect
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/promote.yml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 4b7f08b6e9..0ff16aa32e 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -47,12 +47,14 @@ jobs: COLLECTION_TEMPLATE_VERSION: true run: | make build_collection - if [ "$(curl -L --head -sw '%{http_code}' https://galaxy.ansible.com/download/${{ env.collection_namespace }}-awx-${{ github.event.release.tag_name }}.tar.gz | tail -1)" == "302" ] ; then \ - echo "Galaxy release already done"; \ - else \ + curl_with_redirects=$(curl --head -sLw '%{http_code}' https://galaxy.ansible.com/download/${{ env.collection_namespace }}-awx-${{ github.event.release.tag_name }}.tar.gz | tail -1) + curl_without_redirects=$(curl --head -sw '%{http_code}' https://galaxy.ansible.com/download/${{ env.collection_namespace }}-awx-${{ github.event.release.tag_name }}.tar.gz | tail -1) + if [[ "$curl_with_redirects" == "302" ]] || [[ "$curl_without_redirects" == "302" ]]; then + echo "Galaxy release already done"; + else ansible-galaxy collection publish \ --token=${{ secrets.GALAXY_TOKEN }} \ - awx_collection_build/${{ env.collection_namespace }}-awx-${{ github.event.release.tag_name }}.tar.gz; \ + awx_collection_build/${{ env.collection_namespace }}-awx-${{ github.event.release.tag_name }}.tar.gz; fi - name: Set official pypi info |