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

refactor(release): align plugins release number to branch name in testing context #5392

Merged
21 changes: 17 additions & 4 deletions .github/workflows/get-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,24 @@ jobs:

- name: "Get release: 1 for testing / stable, <date>.<commit_sha> for others"
id: get_release
run: |
RELEASE=$(date '+%H%M%S')
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
let release = '';

if (${{ steps.get_stability.outputs.stability }} === 'testing') {
mushroomempires marked this conversation as resolved.
Show resolved Hide resolved
const branchName = "${{ github.ref_name }}";
const matches = branchName.match(/^(?:release|hotfix)-(\d{8})$/);
if (matches) {
release = matches[1];
} else {
throw new Error('invalid release name');
}
} else {
release = new Date().toLocaleTimeString('en-US', { hour12: false }).replaceAll(":","")
mushroomempires marked this conversation as resolved.
Show resolved Hide resolved
}

echo "release=$RELEASE" >> $GITHUB_OUTPUT
shell: bash
core.setOutput('release', release);

- name: "Get release type: hotfix, release or not defined if not a release"
id: get_release_type
Expand Down