Skip to content

Commit

Permalink
Fixed pipeline for correct sorting of beta and rc
Browse files Browse the repository at this point in the history
  • Loading branch information
erseco committed May 23, 2024
1 parent 1730025 commit f461236
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/check-moodle-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
schedule:
- cron: '0 0 * * *' # Run this task daily
workflow_dispatch: # Allows manually triggering

jobs:
check-version-and-tag:
runs-on: ubuntu-latest
Expand All @@ -23,14 +24,16 @@ jobs:
- name: Create Tag if New
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LATEST_WP_VERSION: ${{ env.LATEST_WP_VERSION }}
GH_PAT: ${{ secrets.GH_PAT }}
LATEST_MOODLE_VERSION: ${{ env.LATEST_MOODLE_VERSION }}
GH_PAT: ${{ secrets.GH_PAT }}
run: |
CURRENT_VERSION=$(git tag --sort=-v:refname | head -n 1)
# Get the highest version tag from the repo, using version sorting
CURRENT_VERSION=$(git tag | sort -V | tail -n 1)
echo "Latest MOODLE Version from API: $LATEST_MOODLE_VERSION"
echo "Current MOODLE version from Git tags: $CURRENT_VERSION"
if [ "$CURRENT_VERSION" != "$LATEST_MOODLE_VERSION" ]; then
# Compare versions
if [ "$(printf '%s\n' "$LATEST_MOODLE_VERSION" "$CURRENT_VERSION" | sort -V | head -n 1)" != "$LATEST_MOODLE_VERSION" ]; then
echo "Creating new tag for $LATEST_MOODLE_VERSION"
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
Expand Down

0 comments on commit f461236

Please sign in to comment.