Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(release): fix plugins version detection on stable branch runs #5439

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .github/workflows/get-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions .version.plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20250201