Skip to content

Commit 77d9a30

Browse files
committed
feature(CI): add env and segment secret
1 parent 099035d commit 77d9a30

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/deploy-extension.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Publish extension
2-
on: [push]
2+
on:
3+
push:
4+
branches:
5+
- main
6+
release:
7+
types:
8+
- created
39

410
jobs:
511
build:
@@ -19,3 +25,10 @@ jobs:
1925
if: runner.os == 'Linux'
2026
- run: npm test
2127
if: runner.os != 'Linux'
28+
- name: Publish
29+
if: success() && startsWith( github.ref, 'refs/tags/releases/') && matrix.os == 'ubuntu-latest'
30+
run: npm run deploy
31+
env:
32+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
33+
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }}
34+

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as FileUtils from './file-utils';
55
import * as Snippets from "./snippets";
66
import { kebabCasify, stringToUintArray } from './utils/string-manipulation';
77

8-
var analytics = new Analytics('KEY_HERE');
8+
var analytics = new Analytics(process.env.SEGMENT_KEY || "");
99

1010
async function onCreateDirectories(selectedFolder: vscode.Uri) {
1111
analytics.track({

0 commit comments

Comments
 (0)