From 09b98975dbe0845bc547eb2b206c190442992817 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Thu, 31 Oct 2024 20:06:23 +0500 Subject: [PATCH] updates to realease version --- .github/workflows/release-version-update.yml | 30 +++++++++++++------- src/templates/base.html | 2 +- version.json | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-version-update.yml b/.github/workflows/release-version-update.yml index c62158d1f..8105bc885 100644 --- a/.github/workflows/release-version-update.yml +++ b/.github/workflows/release-version-update.yml @@ -14,9 +14,15 @@ jobs: - name: Get release information id: get_release - uses: dawidd6/action-get-latest-release@v3 - with: - release: true + run: | + response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest) + echo "$response" | jq '.tag_name, .name, .published_at, .body, .html_url' | tee /tmp/release_info + echo "::set-output name=tag_name::$(echo "$response" | jq -r .tag_name)" + echo "::set-output name=name::$(echo "$response" | jq -r .name)" + echo "::set-output name=published_at::$(echo "$response" | jq -r .published_at)" + echo "::set-output name=body::$(echo "$response" | jq -r .body)" + echo "::set-output name=html_url::$(echo "$response" | jq -r .html_url)" + - name: Update version.json run: | @@ -25,7 +31,7 @@ jobs: "release_name": "${{ steps.get_release.outputs.name }}", "published_at": "${{ steps.get_release.outputs.published_at }}", "body": "${{ steps.get_release.outputs.body }}" - "release_url": "${{ steps.get_release.outputs.html_url }}" + "html_url": "${{ steps.get_release.outputs.html_url }}" }' > version.json - name: Create new branch @@ -41,10 +47,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: update-version-${{ steps.get_release.outputs.tag_name }} - title: "Update version.json for release ${{ steps.get_release.outputs.tag_name }}" - body: "This PR updates version.json with the latest release information." - base: develop # Target branch for the pull request + run: | + curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/pulls \ + -d '{ + "title": "Update version.json for release ${{ steps.get_release.outputs.tag_name }}", + "body": "This PR updates version.json with the latest release information.", + "head": "update-version-${{ steps.get_release.outputs.tag_name }}", + "base": "develop" + }' diff --git a/src/templates/base.html b/src/templates/base.html index 8b0271172..337eba159 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -229,7 +229,7 @@

CodaBench

{% if VERSION_INFO.tag_name != 'invalid' and VERSION_INFO.tag_name != 'unknown' %}
- {{ VERSION_INFO.tag_name }} + {{ VERSION_INFO.tag_name }}
{% endif %} diff --git a/version.json b/version.json index 6d0c65f69..7bc02172f 100644 --- a/version.json +++ b/version.json @@ -3,5 +3,5 @@ "release_name": "Release 1.11.0", "published_at": "2024-09-16", "body": "", - "release_url": "https://github.com/codalab/codabench/releases/tag/v1.11.0" + "html_url": "https://github.com/codalab/codabench/releases/tag/v1.11.0" } \ No newline at end of file