Skip to content

Commit

Permalink
Support only the version that the Redmine community supports
Browse files Browse the repository at this point in the history
  • Loading branch information
hidakatsuya committed Jul 13, 2024
1 parent a4845e8 commit 70407cc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ This action installs Redmine and sets up an environment to run tests. It is prim
See also [action.yml](./action.yml).
## Supported Redmine version
v4.2 or later
## Example
### Setting up [RedMica](https://github.com/redmica/redmica)
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ runs:
env:
REDMINE_DIR: ${{ inputs.path }}

- name: Check supported Redmine version
run: |
if [ $redmine_version_number -lt $MINIUMUM_SUPPORTED_REDMINE_VERSION ]; then
echo "Redmine version $REDMINE_VERSION is not supported."
exit 1
fi
shell: bash
env:
MINIUMUM_SUPPORTED_REDMINE_VERSION: "420" # v4.2.0

- name: Set up base environment
run: |
# For example: v5.1.3.stable -> "setup-base-5.1.sh"
Expand Down
13 changes: 12 additions & 1 deletion scripts/set-version-envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@ version_minor=$(grep -oE 'MINOR *= *[0-9]+' $file | awk 'NR==1 {print $3}')
version_tiny=$(grep -oE 'TINY *= *[0-9]+' $file | awk 'NR==1 {print $3}')
version_branch=$(grep -oE 'BRANCH *= *'\''.+?' $file | awk -F"'" 'NR==1 {print $2}')

echo "Redmine Version: $version_major.$version_minor.$version_tiny.$version_branch"
# v5.1.3.stable -> 5.1.3.stable
redmine_version=$version_major.$version_minor.$version_tiny.$version_branch
echo "REDMINE_VERSION=$redmine_version" >> $GITHUB_ENV

# v5.1.3.stable -> 5
echo "REDMINE_VERSION_MAJOR=$version_major" >> $GITHUB_ENV
# v5.1.3.stable -> 1
echo "REDMINE_VERSION_MINOR=$version_minor" >> $GITHUB_ENV
# v5.1.3.stable -> 3
echo "REDMINE_VERSION_TINY=$version_tiny" >> $GITHUB_ENV
# v5.1.3.stable -> stable
echo "REDMINE_VERSION_BRANCH=$version_branch" >> $GITHUB_ENV

# v5.1.3.stable -> 513
echo "REDMINE_VERSION_NUMNER=$version_major$version_minor$version_tiny" >> $GITHUB_ENV

echo "Redmine Version: $redmine_version"

0 comments on commit 70407cc

Please sign in to comment.