diff --git a/.github/workflows/get-environment.yml b/.github/workflows/get-environment.yml index 8c9bbcd351..f0b96332e4 100644 --- a/.github/workflows/get-environment.yml +++ b/.github/workflows/get-environment.yml @@ -251,7 +251,41 @@ jobs: script: | let version = ''; - if ('${{ steps.get_stability.outputs.stability }}' === 'testing') { + if ${{ steps.get_stability.outputs.stability }}' === 'stable' { + const { owner, repo } = context.repo; + + // Fetch the most recent tag for plugins + const { data: tags } = await github.rest.repos.listTags({ + owner, + repo, + per_page: 1 + }); + + let latestTag = null; + let latestDate = 0; + + // Filter tags matching format plugins-YYYYMMDD + for (const tag of tags) { + const match = tag.name.match(/^plugins-(\d{8})$/); + + // log non matching just for debug + if (!match) { + console.log(`Skipping non-matching tag: ${tag.name}`); + continue; + } + + const tagDate = parseInt(match[1], 10); + + // get latest tag + if (tagDate > latestDate) { + latestTag = tag.name; + latestDate = tagDate; + } + } + + console.log("Most recent tag found: $latestTag") + + } else if ('${{ steps.get_stability.outputs.stability }}' === 'testing') { const branchName = "${{ github.ref_name }}"; const matches = branchName.match(/^(?:release|hotfix)-(\d{8})$/); if (matches) { diff --git a/.version.plugins b/.version.plugins new file mode 100644 index 0000000000..5eb4b6f49e --- /dev/null +++ b/.version.plugins @@ -0,0 +1 @@ +20250201 \ No newline at end of file