Skip to content

JDTLS Milestone Release Checker #1

JDTLS Milestone Release Checker

JDTLS Milestone Release Checker #1

name: JDTLS Milestone Release Checker
on:
schedule:
# Runs daily at midnight UTC
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
check-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get latest milestone from Eclipse
id: get_latest
run: |
pip install requests
echo "latest_version=$(python ./get_latest.py)" >> $GITHUB_ENV
- name: Check if release already exists
id: check_release
run: |
EXISTING_RELEASE=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases \
| jq -r --arg version "${{ env.latest_version }}" '.[] | select(.tag_name==$version) | .tag_name')
if [ "$EXISTING_RELEASE" = "${{ env.latest_version }}" ]; then
echo "Release $EXISTING_RELEASE already exists. Skipping."
echo "release_exists=true" >> $GITHUB_ENV
else
echo "Release does not exist."
echo "release_exists=false" >> $GITHUB_ENV