Skip to content

ci: create release of vscode extension #4765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged

Conversation

benfdking
Copy link
Contributor

No description provided.

@benfdking benfdking force-pushed the adding_release_for_vscode branch from 4ccf83d to 3517c57 Compare June 24, 2025 15:49
Comment on lines 8 to 44
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 10
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Extract version from tag
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/tags/vscode@v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Update package.json version
working-directory: vscode/extension
run: |
npm version ${{ steps.extract_version.outputs.VERSION }} --no-git-tag-version
- name: Install dependencies
working-directory: vscode/extension
run: pnpm install
- name: Run CI
run: pnpm run ci
- name: Build extension
working-directory: vscode/extension
run: pnpm run vscode:package
- name: Package extension
working-directory: vscode/extension
run: |
pnpm run vscode:package
- name: Upload extension to Marketplace
working-directory: vscode/extension
run: |
pnpx vsce publish --packagePath sqlmesh-${{ steps.extract_version.outputs.VERSION }}.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 25 days ago

To fix the issue, add a permissions block to the workflow. This block should specify the minimal permissions required for the workflow to function correctly. Based on the operations performed in the workflow, the following permissions are recommended:

  • contents: read for accessing repository contents.
  • packages: write for publishing the extension to the Marketplace.

The permissions block should be added at the root level of the workflow to apply to all jobs, as no job-specific permissions are defined.

Suggested changeset 1
.github/workflows/release_extension.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release_extension.yaml b/.github/workflows/release_extension.yaml
--- a/.github/workflows/release_extension.yaml
+++ b/.github/workflows/release_extension.yaml
@@ -5,2 +5,5 @@
       - 'vscode@v*'
+permissions:
+  contents: read
+  packages: write
 jobs:
EOF
@@ -5,2 +5,5 @@
- 'vscode@v*'
permissions:
contents: read
packages: write
jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
@benfdking benfdking committed this autofix suggestion 25 days ago.
@benfdking benfdking requested a review from Copilot June 24, 2025 16:25
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new GitHub Actions workflow to automate the release process for the VSCode extension.

  • Adds a workflow triggered by push tags matching the pattern "vscode@v*".
  • Implements steps for checking out code, setting up Node.js, installing dependencies, extracting version, updating package.json, building, packaging, and uploading the extension.

@benfdking benfdking force-pushed the adding_release_for_vscode branch from 5e26dbd to 33aff98 Compare June 25, 2025 09:28
@benfdking benfdking force-pushed the adding_release_for_vscode branch from 33aff98 to 5c97517 Compare June 25, 2025 09:54
@benfdking benfdking merged commit 34b05d6 into main Jun 25, 2025
25 checks passed
@benfdking benfdking deleted the adding_release_for_vscode branch June 25, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants