Skip to content

Commit d1e61ba

Browse files
Add workflow to check Upstream VS Code Release
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com> Generated-by: Cursor AI
1 parent 2f1ac0e commit d1e61ba

1 file changed

Lines changed: 116 additions & 0 deletions

File tree

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#
2+
# Copyright (c) 2026 Red Hat, Inc.
3+
# This program and the accompanying materials are made
4+
# available under the terms of the Eclipse Public License 2.0
5+
# which is available at https://www.eclipse.org/legal/epl-2.0/
6+
#
7+
# SPDX-License-Identifier: EPL-2.0
8+
#
9+
10+
#
11+
# This file was generated using AI assistance (Cursor AI)
12+
# and reviewed by the maintainers.
13+
#
14+
15+
name: Check Upstream VS Code Release
16+
17+
on:
18+
schedule:
19+
- cron: '0 8 * * 1-5'
20+
workflow_dispatch:
21+
22+
jobs:
23+
check-upstream:
24+
runs-on: ubuntu-22.04
25+
permissions:
26+
issues: write
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Get current upstream version from rebase.sh
33+
id: current
34+
run: |
35+
CURRENT=$(grep '^CURRENT_UPSTREAM_VERSION=' rebase.sh | sed 's/CURRENT_UPSTREAM_VERSION="//' | sed 's/"//')
36+
echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
37+
echo "Current upstream version: $CURRENT"
38+
39+
- name: Check for newer VS Code release branches
40+
id: check
41+
run: |
42+
CURRENT="${{ steps.current.outputs.version }}"
43+
CURRENT_MINOR=$(echo "$CURRENT" | grep -oP '\d+\.\d+' | cut -d. -f2)
44+
echo "Current minor version: $CURRENT_MINOR"
45+
46+
LATEST_MINOR="$CURRENT_MINOR"
47+
LATEST_BRANCH=""
48+
49+
for i in $(seq 1 10); do
50+
CHECK_MINOR=$((CURRENT_MINOR + i))
51+
BRANCH="release/1.${CHECK_MINOR}"
52+
if git ls-remote --heads https://github.com/microsoft/vscode.git "$BRANCH" | grep -q "$BRANCH"; then
53+
echo "Found branch: $BRANCH"
54+
LATEST_MINOR="$CHECK_MINOR"
55+
LATEST_BRANCH="$BRANCH"
56+
else
57+
break
58+
fi
59+
done
60+
61+
if [ -n "$LATEST_BRANCH" ]; then
62+
echo "new_release=true" >> "$GITHUB_OUTPUT"
63+
echo "latest_branch=$LATEST_BRANCH" >> "$GITHUB_OUTPUT"
64+
echo "New release branch found: $LATEST_BRANCH"
65+
else
66+
echo "new_release=false" >> "$GITHUB_OUTPUT"
67+
echo "No new release branch found"
68+
fi
69+
70+
- name: Check if issue already exists
71+
if: steps.check.outputs.new_release == 'true'
72+
id: existing
73+
env:
74+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: |
76+
LATEST="${{ steps.check.outputs.latest_branch }}"
77+
VERSION=$(echo "$LATEST" | sed 's|release/||')
78+
79+
EXISTING=$(gh issue list \
80+
--repo "${{ github.repository }}" \
81+
--search "Alignment Che-Code with ${VERSION}" \
82+
--state open \
83+
--json number \
84+
--jq 'length')
85+
86+
if [ "$EXISTING" -gt 0 ]; then
87+
echo "exists=true" >> "$GITHUB_OUTPUT"
88+
echo "Issue already exists, skipping creation"
89+
else
90+
echo "exists=false" >> "$GITHUB_OUTPUT"
91+
fi
92+
93+
- name: Create issue
94+
if: steps.check.outputs.new_release == 'true' && steps.existing.outputs.exists == 'false'
95+
env:
96+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
LATEST_BRANCH: ${{ steps.check.outputs.latest_branch }}
98+
run: |
99+
VERSION=$(echo "$LATEST_BRANCH" | sed 's|release/||')
100+
101+
cat > /tmp/issue-body.md <<EOF
102+
### Is your task related to a problem? Please describe
103+
104+
Alignment Che-Code with \`${VERSION}.x\` version of VS Code
105+
106+
### Describe the solution you'd like
107+
108+
Fix the incompatibility with the upstream.
109+
110+
### Additional context
111+
EOF
112+
113+
gh issue create \
114+
--repo "${{ github.repository }}" \
115+
--title "Alignment Che-Code with ${VERSION}.x version of VS Code" \
116+
--body-file /tmp/issue-body.md

0 commit comments

Comments
 (0)