Skip to content

Added fetch-tags: true #3

Added fetch-tags: true

Added fetch-tags: true #3

name: Check Moodle Version and Tag
on:
schedule:
- cron: '0 0 * * *' # Run this task daily
jobs:
check-version-and-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

Check failure on line 13 in .github/workflows/check-moodle-version.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/check-moodle-version.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
fetch-tags: true
- name: Check Moodle Latest Version
id: check_moodle
run: |
LATEST_MOODLE_VERSION=$(curl -s https://api.github.com/repos/moodle/moodle/tags | jq -r '.[0].name')
echo "LATEST_MOODLE_VERSION=$LATEST_MOODLE_VERSION" >> $GITHUB_ENV
- name: Create Tag if New
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CURRENT_VERSION=$(git tag --sort=-v:refname | head -n 1)
if [ "$CURRENT_VERSION" != "$LATEST_MOODLE_VERSION" ]; then
echo "Latest version is already tagged"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag $LATEST_MOODLE_VERSION
git push origin $LATEST_MOODLE_VERSION
fi