diff --git a/.github/workflows/update-supported-enterprise-server-versions.yml b/.github/workflows/update-supported-enterprise-server-versions.yml index 5436c30674..543efa77ca 100644 --- a/.github/workflows/update-supported-enterprise-server-versions.yml +++ b/.github/workflows/update-supported-enterprise-server-versions.yml @@ -35,14 +35,22 @@ jobs: npm run build env: ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/ - - name: Commit Changes - uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5.0.1 - with: - commit-message: Update supported GitHub Enterprise Server versions. - title: Update supported GitHub Enterprise Server versions. - body: "" - author: GitHub - branch: update-supported-enterprise-server-versions - draft: true + + - name: Update git config + run: | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + - name: Commit changes and open PR env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [[ -z $(git status --porcelain) ]]; then + echo "No changes to commit" + else + git checkout -b update-supported-enterprise-server-versions + git add . + git commit --message "Update supported GitHub Enterprise Server versions" + git push origin update-supported-enterprise-server-versions + gh pr create --fill --draft + fi diff --git a/.github/workflows/update-supported-enterprise-server-versions/update.py b/.github/workflows/update-supported-enterprise-server-versions/update.py index d09501ed2f..7d9f7d3089 100755 --- a/.github/workflows/update-supported-enterprise-server-versions/update.py +++ b/.github/workflows/update-supported-enterprise-server-versions/update.py @@ -35,7 +35,10 @@ def main(): if oldest_supported_release is None or release_version < oldest_supported_release: end_of_life_date = datetime.date.fromisoformat(release_data["end"]) - if end_of_life_date > datetime.date.today(): + # The GHES version is not actually end of life until the end of the day specified by + # `end_of_life_date`. Wait an extra week to be safe. + is_end_of_life = datetime.date.today() > end_of_life_date + datetime.timedelta(weeks=1) + if not is_end_of_life: oldest_supported_release = release_version api_compatibility_data = {