Skip to content

Commit 6b28177

Browse files
committed
Added initial release tag checking
1 parent 5dfff79 commit 6b28177

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

.github/workflows/update-automation.yaml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,44 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
run:
9+
update-automation:
10+
name: Run Automation Tasks
1011
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1114
steps:
12-
- run: echo "Scheduled job to run automation tasks"
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: true
19+
20+
- name: Check if update needed
21+
run: |
22+
cd third-party-src
23+
git fetch --tags
24+
CURRENT_TAG=$(git describe --tags --exact-match HEAD 2>/dev/null | head -1 || echo "")
25+
cd ..
26+
27+
LATEST_TAG=$(curl -L \
28+
-H "Accept: application/vnd.github+json" \
29+
-H "X-GitHub-Api-Version: 2022-11-28" \
30+
https://api.github.com/repos/microsoft/vscode/releases/latest | jq -r '.tag_name')
31+
32+
echo "Current tag: $CURRENT_TAG"
33+
echo "Latest tag: $LATEST_TAG"
34+
35+
if [ "$CURRENT_TAG" = "$LATEST_TAG" ]; then
36+
echo "Submodule is up to date with latest VS Code release"
37+
exit 0
38+
else
39+
echo "Update needed: $CURRENT_TAG -> $LATEST_TAG"
40+
41+
# Create staging branch
42+
STAGING_BRANCH="staging-code-editor-$LATEST_TAG"
43+
echo "Creating staging branch: $STAGING_BRANCH"
44+
45+
git checkout -b "$STAGING_BRANCH"
46+
git push origin "$STAGING_BRANCH"
47+
48+
echo "Created staging branch: $STAGING_BRANCH"
49+
fi

0 commit comments

Comments
 (0)