Skip to content

Commit 771e922

Browse files
committed
stable redirects to version marked as latest
1 parent 8a247ca commit 771e922

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,16 @@ jobs:
113113
env:
114114
SPHINX_DOCS_RELEASE: ${{ github.ref_name }}
115115
SPHINX_DOCS_VERSION: ${{ github.ref_name }}
116-
- id: latest_bo4e
117-
name: Get latest BO4E release tag
118-
uses: pozetroninc/github-action-get-latest-release@master
119-
with:
120-
repository: ${{ github.repository }}
121-
token: ${{ secrets.GITHUB_TOKEN }}
116+
- name: Export LATEST_TAG
117+
run: |
118+
echo "LATEST_TAG=$(curl -qsSL \
119+
-H "Accept: application/vnd.github+json" \
120+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
121+
-H "X-GitHub-Api-Version: 2022-11-28" \
122+
"${{ github.api_url }}/repos/${{ github.repository }}/releases/latest" \
123+
| jq -r .tag_name)" >> $GITHUB_ENV
122124
- name: Redirect stable to new release if the new release is marked as latest
123-
if: steps.latest_bo4e.outputs.release == github.ref_name
125+
if: ${{ env.LATEST_TAG == github.ref_name }}
124126
run: |
125127
echo "Redirecting stable to new version ${{ github.ref_name }}"
126128
rm -rf stable

0 commit comments

Comments
 (0)