-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpackage-vulnerability-scanner.yml
More file actions
80 lines (68 loc) · 2.8 KB
/
package-vulnerability-scanner.yml
File metadata and controls
80 lines (68 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Package Vulnerability Scanner
on:
workflow_call:
# Setup the environment with the extension name for easy re-use
# Also need the GH_TOKEN for the release-extension action to be able to use gh
env:
EXTENSION_NAME: package-vulnerability-scanner
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
extension:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./extensions/${{ env.EXTENSION_NAME }}
steps:
# Checkout the repository so the rest of the actions can run with no issue
- uses: actions/checkout@v4
# We want to fail quickly if the linting fails, do that first
- uses: ./.github/actions/lint-extension
with:
extension-name: ${{ env.EXTENSION_NAME }}
# Publisher Command Center needs to setup node, install dependencies, and
# build to make the files needed for the extension
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: extensions/${{ env.EXTENSION_NAME }}/package-lock.json
- run: npm ci
- run: npm run build
# Now that the extension is built we need to upload an artifact to pass
# to the package-extension action that contains the files we want to be
# included in the extension
# This only includes necessary files for the extension to run leaving out
# the files that were used to build the /dist/ directory
- name: Upload built extension
uses: actions/upload-artifact@v4
with:
name: ${{ env.EXTENSION_NAME }}
path: |
extensions/${{ env.EXTENSION_NAME }}/dist/
extensions/${{ env.EXTENSION_NAME }}/requirements.txt
extensions/${{ env.EXTENSION_NAME }}/main.py
extensions/${{ env.EXTENSION_NAME }}/manifest.json
# Package up the extension into a TAR using the generalized
# package-extension action
- uses: ./.github/actions/package-extension
with:
extension-name: ${{ env.EXTENSION_NAME }}
artifact-name: ${{ env.EXTENSION_NAME }}
connect-integration-tests:
needs: extension
uses: ./.github/workflows/connect-integration-tests.yml
secrets: inherit
with:
extensions: '["package-vulnerability-scanner"]' # JSON array format to match the workflow input schema
release:
runs-on: ubuntu-latest
needs: [extension, connect-integration-tests]
# Release the extension using the release-extension action
# Will only create a GitHub release if merged to `main` and the semver
# version has been updated
steps:
# Checkout the repository so the rest of the actions can run with no issue
- uses: actions/checkout@v4
- uses: ./.github/actions/release-extension
with:
extension-name: ${{ env.EXTENSION_NAME }}