Skip to content

Commit 314cc12

Browse files
authored
chore: add release-please automation and replace coana with socket (#89)
* add release-please automation and PR title linting * add pre-major version bump settings for 0.x semver * chore: formatting: * chore: replace coana with socket tier 1 reachability analysis * chore: formatting: * fix: add secrets inherit and fix publish job ID * chore: pin actions to SHA and add renovate config * chore: formatting:
1 parent fd3152a commit 314cc12

10 files changed

Lines changed: 144 additions & 117 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
name: Pre-merge Checks
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v4
14+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
15+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1616
with:
1717
node-version: 20
1818

.github/workflows/coana-analysis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/coana-guardrail.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint PR Title
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize]
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
tag_name: ${{ steps.release.outputs.tag_name }}
19+
steps:
20+
- name: Generate token
21+
id: generate-token
22+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2
23+
with:
24+
app-id: ${{ vars.SDK_BOT_APP_ID }}
25+
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
26+
27+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
28+
id: release
29+
with:
30+
token: ${{ steps.generate-token.outputs.token }}
31+
32+
publish:
33+
needs: release-please
34+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
35+
uses: ./.github/workflows/release.yml
36+
secrets: inherit

.github/workflows/release.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
name: Release
22

33
on:
4-
# Support manually pushing a new release
5-
workflow_dispatch: {}
6-
# Trigger when a release is published
7-
release:
8-
types: [published]
4+
workflow_dispatch:
5+
workflow_call:
96

107
defaults:
118
run:
@@ -19,26 +16,17 @@ jobs:
1916
contents: read
2017
id-token: write
2118
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-node@v4
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
2421
with:
2522
node-version: 24
2623
registry-url: "https://registry.npmjs.org"
2724

2825
- name: Install Dependencies
29-
run: |
30-
npm install
26+
run: npm install
3127

3228
- name: Build project
33-
run: |
34-
npm run build
29+
run: npm run build
3530

36-
- name: Push Release
37-
if: ${{ !github.event.release.prerelease }}
38-
run: |
39-
npm publish --tag latest --access=public --provenance
40-
41-
- name: Push Pre-Release
42-
if: ${{ github.event.release.prerelease }}
43-
run: |
44-
npm publish --tag next --access=public --provenance
31+
- name: Publish
32+
run: npm publish --tag latest --access=public --provenance --no-git-checks
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Socket Tier 1 Reachability Analysis
2+
3+
on:
4+
schedule:
5+
# every day at 12 AM
6+
- cron: "0 0 * * *"
7+
workflow_dispatch:
8+
inputs:
9+
tags:
10+
description: "Manually run vulnerability analysis"
11+
distinct_id:
12+
description: "Required by the return-dispatch action"
13+
required: true
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref_name }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
socket-vulnerability-analysis:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 60
23+
24+
steps:
25+
- name: Check distinct_id
26+
run: |
27+
echo "distinct_id: ${{ github.event.inputs.distinct_id }}"
28+
- name: Checkout code
29+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
30+
- name: Install Socket CLI
31+
run: npm install -g socket
32+
- name: Run Tier 1 reachability scan
33+
env:
34+
SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_API_KEY }}
35+
run: |
36+
# Full application reachability (Tier 1)
37+
socket scan create . \
38+
--reach \
39+
--org "workos" \
40+
--no-interactive

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.16.0"
3+
}

release-please-config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"include-component-in-tag": false,
4+
"packages": {
5+
".": {
6+
"release-type": "node",
7+
"changelog-path": "CHANGELOG.md",
8+
"versioning": "default",
9+
"bump-minor-pre-major": true,
10+
"bump-patch-for-minor-pre-major": true
11+
}
12+
}
13+
}

renovate.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"extends": ["config:recommended"],
3+
"schedule": ["on the 15th day of the month before 12pm"],
4+
"timezone": "UTC",
5+
"rebaseWhen": "conflicted",
6+
"packageRules": [
7+
{
8+
"matchManagers": ["github-actions"],
9+
"extractVersion": "^v(?<version>\\d+\\.\\d+\\.\\d+)$",
10+
"groupName": "github-actions"
11+
},
12+
{
13+
"matchUpdateTypes": ["minor", "patch"],
14+
"automerge": true,
15+
"groupName": "minor and patch updates"
16+
},
17+
{
18+
"matchUpdateTypes": ["major"],
19+
"automerge": false
20+
},
21+
{
22+
"matchUpdateTypes": ["digest"],
23+
"automerge": false
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)