Skip to content

Commit 7f09077

Browse files
CopilotFlywithYou1
andcommitted
Add comprehensive error handling for artifact operations
Co-authored-by: FlywithYou1 <137418305+FlywithYou1@users.noreply.github.com>
1 parent a488abe commit 7f09077

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

‎.github/workflows/build-vsix.yml‎

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ jobs:
7777
- name: Push artifacts to release branch
7878
if: github.event_name == 'schedule'
7979
run: |
80+
# Verify VSIX files exist
81+
if ! ls kotlin-vscode-*.vsix 1> /dev/null 2>&1; then
82+
echo "Error: No VSIX files found to push to release branch"
83+
exit 1
84+
fi
85+
8086
# Save VSIX files to a temporary location
8187
mkdir -p /tmp/vsix-artifacts
8288
cp kotlin-vscode-*.vsix /tmp/vsix-artifacts/
@@ -97,15 +103,15 @@ jobs:
97103
# Copy VSIX files from temporary location to release branch
98104
cp /tmp/vsix-artifacts/*.vsix .
99105
100-
# Add and commit artifacts
101-
if ls *.vsix 1> /dev/null 2>&1; then
102-
git add *.vsix
103-
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
104-
git commit -m "Build artifacts from ${TIMESTAMP} (${GITHUB_SHA:0:7})"
105-
106-
# Push to release branch
107-
git push origin release
108-
else
109-
echo "No VSIX files found to commit"
106+
# Verify files were copied and commit
107+
if ! ls *.vsix 1> /dev/null 2>&1; then
108+
echo "Error: Failed to copy VSIX files to release branch"
110109
exit 1
111110
fi
111+
112+
git add *.vsix
113+
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
114+
git commit -m "Build artifacts from ${TIMESTAMP} (${GITHUB_SHA:0:7})"
115+
116+
# Push to release branch
117+
git push origin release

0 commit comments

Comments
 (0)