Skip to content

Check Upstream VS Code Release #28

Check Upstream VS Code Release

Check Upstream VS Code Release #28

#
# Copyright (c) 2026 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
#
# This file was generated using AI assistance (Cursor AI)
# and reviewed by the maintainers.
#
name: Check Upstream VS Code Release
on:
schedule:
- cron: '0 8 * * 1-5'
workflow_dispatch:
jobs:
check-upstream:
runs-on: ubuntu-22.04
permissions:
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get current upstream version from rebase.sh
id: current
run: |
CURRENT=$(grep '^CURRENT_UPSTREAM_VERSION=' rebase.sh | sed 's/CURRENT_UPSTREAM_VERSION="//' | sed 's/"//')
echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
echo "Current upstream version: $CURRENT"
- name: Check for next VS Code release branch
id: check
run: |
CURRENT="${{ steps.current.outputs.version }}"
CURRENT_MINOR=$(echo "$CURRENT" | grep -oP '\d+\.\d+' | cut -d. -f2)
NEXT_MINOR=$((CURRENT_MINOR + 1))
BRANCH="release/1.${NEXT_MINOR}"
echo "Current minor: $CURRENT_MINOR, checking next: $BRANCH"
if git ls-remote --heads https://github.com/microsoft/vscode.git "$BRANCH" | grep -q "$BRANCH"; then
echo "new_release=true" >> "$GITHUB_OUTPUT"
echo "next_branch=$BRANCH" >> "$GITHUB_OUTPUT"
echo "Next release branch found: $BRANCH"
else
echo "new_release=false" >> "$GITHUB_OUTPUT"
echo "No next release branch found"
fi
# Only check open issues so closed ones don't block new issue creation.
# TODO: once the automation pipeline is stable, consider also checking
# closed issues to avoid duplicates for the same version.
- name: Check if issue already exists
if: steps.check.outputs.new_release == 'true'
id: existing
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXISTING=$(gh issue list \
--repo "${{ github.repository }}" \
--search "Alignment Che-Code with" \
--state open \
--json number \
--jq 'length')
if [ "$EXISTING" -gt 0 ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "An open alignment issue already exists, skipping creation"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
# Use PAT_TOKEN so the created issue triggers downstream workflows
# (events from GITHUB_TOKEN don't trigger other workflows).
- name: Create issue
if: steps.check.outputs.new_release == 'true' && steps.existing.outputs.exists == 'false'
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
NEXT_BRANCH: ${{ steps.check.outputs.next_branch }}
run: |
VERSION=$(echo "$NEXT_BRANCH" | sed 's|release/||')
cat > /tmp/issue-body.md <<EOF
### Is your task related to a problem? Please describe
Alignment Che-Code with \`${VERSION}.x\` version of VS Code
### Describe the solution you'd like
Fix the incompatibility with the upstream.
### Additional context
EOF
gh issue create \
--repo "${{ github.repository }}" \
--title "Alignment Che-Code with ${VERSION}.x version of VS Code" \
--body-file /tmp/issue-body.md