Skip to content

Check Supported Go Versions #316

Check Supported Go Versions

Check Supported Go Versions #316

name: Check Supported Go Versions
on:
schedule:
- cron: "0 17 * * *"
workflow_dispatch:
inputs:
force_create_issue:
type: boolean
description: 'Create issue even if versions are up-to-date'
required: false
default: false
jobs:
go-versions:
uses: ./.github/workflows/go-versions.yml
check-go-eol:
needs: go-versions
permissions:
issues: write
contents: read
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
# Perform a GET request to endoflife.date for the Go language. The response
# contains all Go releases; we're interested in the 0'th and 1'th (latest and penultimate.)
- name: Fetch officially supported Go versions
uses: JamesIves/fetch-api-data-action@396ebea7d13904824f85b892b1616985f847301c
with:
endpoint: https://endoflife.date/api/go.json
configuration: '{ "method": "GET" }'
debug: true
# Parse the response JSON and insert into environment variables for the next step.
- name: Parse officially supported Go versions
run: |
echo "officialLatestVersion=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_ENV
echo "officialPenultimateVersion=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_ENV
# If the latest official Go version is different from Relay's release version, generate an issue
# with useful details.
- name: Create issue if update required
if: inputs.force_create_issue || (needs.go-versions.outputs.latest != env.officialLatestVersion)
uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELAY_LATEST_VERSION: ${{ needs.go-versions.outputs.latest }}
OFFICIAL_LATEST_VERSION: ${{ env.officialLatestVersion }}
RELAY_PENULTIMATE_VERSION: ${{ needs.go-versions.outputs.penultimate }}
OFFICIAL_PENULTIMATE_VERSION: ${{ env.officialPenultimateVersion }}
with:
filename: .github/ISSUE_TEMPLATE/update_go_versions.md
update_existing: true