Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d7afbe2
Add additional checks & improve ci cd
tirumerla May 11, 2023
c1b13e5
format readme & additional format fixes
tirumerla May 11, 2023
ba30299
run styling in commit stage
tirumerla May 11, 2023
740abcf
Fix merge conflicts
tirumerla May 16, 2023
512cfa5
Add release github action
tirumerla May 16, 2023
ab3092d
Add tagging capabilities
tirumerla May 18, 2023
2156613
Fix node version
tirumerla May 18, 2023
2f3b656
Exclude fixtures from pre-commit EOF to fix failed tests
tirumerla May 18, 2023
8a59ea7
Exclude fixtures from pre-commit EOF to fix failed tests
tirumerla May 18, 2023
22221f1
Fix tests using resolutions
tirumerla May 18, 2023
2dc17bc
Create RC github action
tirumerla May 18, 2023
1ef36d1
Fix syntax
tirumerla May 18, 2023
ca84c02
Validate tag exists condition
tirumerla May 18, 2023
c4c6465
So dumb i missed it
tirumerla May 18, 2023
ee70fd9
Add tag message
tirumerla May 18, 2023
7f10013
Fix typo
tirumerla May 18, 2023
1b447c5
test remove signing
tirumerla May 18, 2023
3cea104
Use service account to sign commits & tag
tirumerla May 18, 2023
9110122
Fix gpg key verification
tirumerla May 19, 2023
dcde906
verify git config
tirumerla May 19, 2023
26ff436
Add stable release publisher
tirumerla May 19, 2023
127daa4
Fix push order to master
tirumerla May 19, 2023
541a9ca
Fix typos
tirumerla May 19, 2023
b3107a5
Format tabs
tirumerla May 19, 2023
38f6706
Add publish workflow
tirumerla May 19, 2023
eb4fd86
Fix indents
tirumerla May 19, 2023
71f1380
remove ref/tags
tirumerla May 19, 2023
05f3e57
Fix missing keys
tirumerla May 19, 2023
91f630e
Add yq installation step
tirumerla May 21, 2023
951cedd
remove manual publish details
tirumerla May 22, 2023
caa080b
Add deterministic build checks & use provenance for publishing
tirumerla May 22, 2023
86e5fda
Fix action outputs
tirumerla May 22, 2023
995cb72
Move slsa to workflow instead of composite action
tirumerla May 22, 2023
fa15861
Use slsa reusable workflow
tirumerla May 23, 2023
6c7a43c
Fix permissions
tirumerla May 23, 2023
85a8a01
Fix provenance file
tirumerla May 23, 2023
e51eb17
Remove commented code
tirumerla May 23, 2023
5a9088a
Fix infinite loop in install
tirumerla May 23, 2023
9cf14e7
Add provenance checks before publishing
tirumerla May 23, 2023
34969eb
Fix path to secure attestations
tirumerla May 23, 2023
57e6359
Fix checking tags
tirumerla May 23, 2023
bfd7665
unzip & verify
tirumerla May 23, 2023
b5a3080
Fix publish & adhoc release workflow
tirumerla May 23, 2023
8f6fdb7
Add badges
tirumerla May 23, 2023
0db08dc
Merge branch 'master' into improve-ci-cd
tirumerla May 23, 2023
814cd2b
Remove static codeQL file
tirumerla May 23, 2023
e3d8245
Use beta tags for rc
tirumerla May 23, 2023
6fe6cf6
USE secure workflow files for gh actions
tirumerla May 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/lib
/test
/test
30 changes: 30 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Pre-requisites
description: |
Setup Pre-requisites

runs:
using: composite
steps:
- name: Use node@16
uses: actions/setup-node@v3
with:
node-version: 16.20.0

- name: Get yarn cache directory path
id: yarn-cache-dir-path
shell: bash
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Node modules cache
uses: actions/cache@v3
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.cache/node-gyp-cache
key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}"
restore-keys: |
${{ runner.os }}-yarn-${{ env.cache-name }}-
env:
cache-name: v4
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

# Maintain dependencies for npm
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
ignore:
- dependency-name: '*'
update-types: [version-update:semver-major]
commit-message:
# Prefix all commit messages
prefix: defender-client-deps
labels:
- dependabot
- dependencies
- vulnerabilites
# Allow up to 5 open pull requests
open-pull-requests-limit: 5
11 changes: 11 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
template: |
## Next Release Version: v$NEXT_MINOR_VERSION

## Changes
$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$NEXT_MINOR_VERSION

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: \<*_&
97 changes: 30 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,40 @@
name: CI
name: ci

on: [push]
on:
pull_request:
types: [assigned, opened, synchronize, reopened, labeled]

jobs:
build:

runs-on: ubuntu-22.04

steps:
- uses: actions/[email protected]

- name: Use node@16
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Node modules cache
uses: actions/cache@v3
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.cache/node-gyp-cache
key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}"
restore-keys: |
${{ runner.os }}-yarn-${{ env.cache-name }}-
env:
cache-name: v4
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

- name: Install dependencies
run: yarn --frozen-lockfile
permissions:
checks: write
pull-requests: read
contents: write
actions: read
id-token: write

- name: Check build
run: yarn build

- name: Check linting
run: yarn lint:check

test:
name: Unit Tests
jobs:
prepare:
name: Prepare pre-requisites
runs-on: ubuntu-22.04
needs: build

steps:
- uses: actions/[email protected]

- name: Use node@16
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Node modules cache
uses: actions/cache@v3
id: yarn-cache
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.cache/node-gyp-cache
key: "${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}"
restore-keys: |
${{ runner.os }}-yarn-${{ env.cache-name }}-
env:
cache-name: v4
egress-policy: audit

- name: Install dependencies
run: yarn --frozen-lockfile
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Build
run: yarn build
- name: Prepare pre-requisites
uses: ./.github/actions/prepare

- name: Run tests
run: yarn test
# Deterministic Build & tests
provenance:
needs: prepare
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
run-scripts: "install-deps, nx-build-test-skip-cache"
node-version: "16.20.0"
76 changes: 0 additions & 76 deletions .github/workflows/codeql.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: publish
description:

on:
workflow_dispatch:
tags:
- 'v*'

jobs:

provenance:
permissions:
contents: read
id-token: write
actions: read

# Deterministic Build & tests
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
run-scripts: "install-deps, nx-build-test-skip-cache"
node-version: "16.20.0"


publish:
runs-on: ubuntu-22.04
permissions:
contents: write
checks: write
id-token: write # For signing
actions: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
egress-policy: audit

- name: Checkout Repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
ref: ${{ github.ref }}

- name: Use node@16
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 16.20.0

- name: Create temp dir
id: temp-dir
run: |
set -euo pipefail

temp_dir=$(mktemp -d)
echo "path=${temp_dir}" >>"${GITHUB_OUTPUT}"

- name: Download tarball
uses: slsa-framework/slsa-github-generator/.github/actions/secure-download-artifact@934435652996c02a6317092984312602dfaf2a21 # main
with:
name: ${{ needs.provenance.outputs.package-download-name }}
path: "${{ steps.temp-dir.outputs.path }}/${{ needs.provenance.outputs.package-name }}"
sha256: ${{ needs.provenance.outputs.package-download-sha256 }}

- name: Download provenance
uses: slsa-framework/slsa-github-generator/actions/nodejs/secure-attestations-download@0779f7bec68e2bf54a7b0a32bf4763f25ab29702 # v1.6.0
with:
name: ${{ needs.provenance.outputs.provenance-download-name }}
path: "${{ steps.temp-dir.outputs.path }}"
sha256: ${{ needs.provenance.outputs.provenance-download-sha256 }}

- name: Authenticate NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Unpack the zipped artifact
run: |
set -euo pipefail

cd "${{ steps.temp-dir.outputs.path }}"
tar -xzvf "${{ needs.provenance.outputs.package-name }}"
cd package/
if [[ ${GITHUB_REF#refs/tags/}" != *rc* ]]; then
yarn publish
else
yarn publish-rc
fi
env:
NPM_CONFIG_PROVENANCE: true
Loading