Skip to content

Fix debug aspnet apps #43

Fix debug aspnet apps

Fix debug aspnet apps #43

name: PR Extension Build
on:
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
build:
runs-on: ubuntu-latest
name: PR Extension Build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install vsce
run: npm install -g vsce
- name: Build the VSIX package
run: vsce package
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: extension-vsix
path: '*.vsix'
- name: Comment on PR with artifact link
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const runId = context.runId;
const prNumber = context.issue.number;
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`;
const message = `## ✅ Extension Build Successful!\n\n` +
`📦 **VSIX artifact is ready for download**\n\n` +
`👉 [View artifacts](${runUrl})\n\n` +
`*Scroll down to the "Artifacts" section and download \`extension-vsix\`*\n\n` +
`To install: In VS Code, run \`Extensions: Install from VSIX...\` and select the downloaded file.`;
// Check if we already commented
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number: prNumber
});
const botComment = comments.find(c =>
c.user.type === 'Bot' && c.body.includes('Extension Build Successful')
);
if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner,
repo,
comment_id: botComment.id,
body: message
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner,
repo,
issue_number: prNumber,
body: message
});
}