Skip to content

Commit 9b947af

Browse files
authored
Fix actor schema validation release flow (#77)
* fix(release): ship 3.0.1 secret input update * fix(ci): update workflows to ensure proper handling of pull requests and improve link check execution * fix: sync schema example version and secret normalization * test: cover missing sync-version branch * test: cover sync-version dashboard example guards * fix: validate Apify input schema in CI * fix: prepare 3.0.2 schema validation release * fix: address remaining pr review feedback
1 parent cd93e95 commit 9b947af

12 files changed

Lines changed: 2539 additions & 119 deletions

File tree

.actor/actor.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
"name": "webhook-debugger-logger",
44
"title": "Webhook Debugger, Logger & API Mocking Suite",
55
"description": "Enterprise-grade tool to test, debug, and mock webhooks. Features real-time SSE streaming, request replay, HTTP forwarding, and JSON schema validation. Perfect for Stripe, GitHub, and Shopify integrations.",
6-
"version": "3.0.1",
6+
"version": "3.0.2",
77
"output": "./output_schema.json",
88
"input": "./input_schema.json",
99
"webServerSchema": "./web_server_schema.json",
1010
"usesStandbyMode": true,
1111
"dockerfile": "../Dockerfile",
12-
"categories": [
13-
"DEVELOPER_TOOLS",
14-
"UTILITIES",
15-
"INTEGRATION_TOOLS"
16-
],
12+
"categories": ["DEVELOPER_TOOLS", "UTILITIES", "INTEGRATION_TOOLS"],
1713
"homepageUrl": "https://apify.com/ar27111994/webhook-debugger-logger",
1814
"storages": {
1915
"dataset": "./dataset_schema.json",

.actor/input_schema.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,19 @@
134134
"example": "my-secret-key-123",
135135
"editor": "textfield"
136136
},
137+
"allowedIps": {
138+
"type": "array",
139+
"title": "IP Whitelist (CIDR)",
140+
"description": "Only accept traffic from these specific IPs or CIDR blocks. Leave blank for public access.",
141+
"editor": "stringList"
142+
},
137143
"signatureVerificationSecret": {
138144
"type": "string",
139145
"title": "Webhook Signing Secret",
140146
"description": "Signing secret used by the webhook provider selected in the 'Webhook Signature Verification' settings below.",
141147
"isSecret": true,
142148
"editor": "textfield"
143149
},
144-
"allowedIps": {
145-
"type": "array",
146-
"title": "IP Whitelist (CIDR)",
147-
"description": "Only accept traffic from these specific IPs or CIDR blocks. Leave blank for public access.",
148-
"editor": "stringList"
149-
},
150150
"signatureVerification": {
151151
"type": "object",
152152
"title": "Webhook Signature Verification",
@@ -215,6 +215,7 @@
215215
"slack": {
216216
"type": "object",
217217
"title": "Slack",
218+
"description": "Slack alert channel settings for webhook notifications.",
218219
"properties": {
219220
"webhookUrl": {
220221
"type": "string",
@@ -227,6 +228,7 @@
227228
"discord": {
228229
"type": "object",
229230
"title": "Discord",
231+
"description": "Discord alert channel settings for webhook notifications.",
230232
"properties": {
231233
"webhookUrl": {
232234
"type": "string",

.actor/web_server_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "Webhook Debugger & Logger API",
55
"description": "OpenAPI description for the Webhook Debugger & Logger Actor web server. Authentication is configuration-driven: when authKey is configured, management routes require either a bearer token or the key query parameter; when authKey is unset, those routes remain accessible without credentials.",
6-
"version": "3.0.1"
6+
"version": "3.0.2"
77
},
88
"servers": [
99
{
@@ -80,7 +80,7 @@
8080
"schema": {
8181
"type": "string"
8282
},
83-
"example": "Webhook Debugger & Logger (v3.0.1)\nActive Webhooks: 1\nSignature Verification: STRIPE"
83+
"example": "Webhook Debugger & Logger (v3.0.2)\nActive Webhooks: 1\nSignature Verification: STRIPE"
8484
}
8585
}
8686
},

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
- name: Lint
3434
run: npm run lint
3535

36-
- name: Validate Web Server Schema
37-
run: npm run validate:web-server-schema
36+
- name: Validate Actor Schemas
37+
run: npm run validate:schemas
3838

3939
- name: Type Check
4040
run: npm run typecheck

.github/workflows/link-check.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,28 @@ jobs:
9696
node - <<'EOF'
9797
const fs = require('node:fs');
9898
99+
const normalizeUrlKey = (value) => {
100+
if (typeof value !== 'string' || value.length === 0) {
101+
return null;
102+
}
103+
104+
try {
105+
const { origin, pathname } = new URL(value);
106+
return `${origin}${pathname}`;
107+
} catch {
108+
return null;
109+
}
110+
};
111+
99112
const results = JSON.parse(fs.readFileSync('lychee/results.json', 'utf8'));
100-
const softHandledUrls = new Set([
113+
const softHandledUrls = [
101114
'https://www.npmjs.com/package/webhook-debugger-logger',
102115
'https://www.npmjs.com/package/isolated-vm?activeTab=readme',
103116
'https://img.shields.io/coderabbit/prs/github/ar27111994/webhook-debugger-logger?utm_source=oss&utm_medium=github&utm_campaign=ar27111994%2Fwebhook-debugger-logger&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews',
104-
]);
117+
];
118+
const softHandledUrlKeys = new Set(
119+
softHandledUrls.map((value) => normalizeUrlKey(value)).filter(Boolean),
120+
);
105121
106122
const softFailures = [];
107123
const hardFailures = [];
@@ -110,8 +126,13 @@ jobs:
110126
for (const failure of failures) {
111127
const url = failure.url;
112128
const code = failure.status?.code;
129+
const normalizedUrl = normalizeUrlKey(url);
113130
114-
if (softHandledUrls.has(url) && (code === 403 || code === 408 || code === 429)) {
131+
if (
132+
normalizedUrl
133+
&& softHandledUrlKeys.has(normalizedUrl)
134+
&& (code === 403 || code === 408 || code === 429)
135+
) {
115136
softFailures.push({ source, url, code, text: failure.status?.text ?? '' });
116137
continue;
117138
}

.github/workflows/release-docker.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,18 @@ jobs:
3939
run: |
4040
owner="${GITHUB_REPOSITORY_OWNER,,}"
4141
release_tag="${RELEASE_TAG:-pr-${{ github.event.pull_request.number || github.run_number }}}"
42-
version="${release_tag#v}"
43-
minor="$(echo "${version}" | cut -d. -f1,2)"
4442
image_name="webhook-debugger-logger"
4543
4644
{
4745
echo "tags<<EOF"
4846
echo "ghcr.io/${owner}/${image_name}:${release_tag}"
49-
echo "ghcr.io/${owner}/${image_name}:${version}"
50-
echo "ghcr.io/${owner}/${image_name}:${minor}"
51-
if [[ "${RELEASE_PRERELEASE}" != "true" ]]; then
47+
if [[ "${GITHUB_EVENT_NAME}" == 'release' ]]; then
48+
version="${release_tag#v}"
49+
minor="$(echo "${version}" | cut -d. -f1,2)"
50+
echo "ghcr.io/${owner}/${image_name}:${version}"
51+
echo "ghcr.io/${owner}/${image_name}:${minor}"
52+
fi
53+
if [[ "${GITHUB_EVENT_NAME}" == 'release' && "${RELEASE_PRERELEASE}" != 'true' ]]; then
5254
echo "ghcr.io/${owner}/${image_name}:latest"
5355
fi
5456
echo "EOF"

.github/workflows/release-npm.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ on:
77
branches: [main]
88

99
jobs:
10-
publish:
10+
validate:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: read
14-
id-token: write # Required for provenance (used in package.json) (optional but good practice)
1514
steps:
1615
- name: Checkout Code
1716
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -25,22 +24,41 @@ jobs:
2524
- name: Install Dependencies
2625
run: npm ci --legacy-peer-deps
2726

28-
- name: Validate Web Server Schema
29-
run: npm run validate:web-server-schema
27+
- name: Validate Actor Schemas
28+
run: npm run validate:schemas
3029

3130
- name: Verify Builds/Tests
3231
run: npm run test:jest -- --detectOpenHandles --forceExit
3332

34-
- name: Skip publish outside release events
33+
- name: Confirm publish is deferred outside release events
3534
if: github.event_name != 'release'
36-
run: echo "PR validation complete; npm publish only runs for published releases."
35+
run: echo "Validation complete; npm publishing only runs in the release-only publish job."
36+
37+
publish:
38+
if: github.event_name == 'release'
39+
needs: validate
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read
43+
id-token: write # Required for npm provenance on published releases.
44+
steps:
45+
- name: Checkout Code
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47+
48+
- name: Setup Node.js
49+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
50+
with:
51+
node-version: "24"
52+
registry-url: "https://registry.npmjs.org"
53+
54+
- name: Install Dependencies
55+
run: npm ci --legacy-peer-deps
3756

3857
# unset NODE_AUTH_TOKEN because it's automatically set by the setup-node action
3958
# node@v24.0.0+
4059
# https://github.com/orgs/community/discussions/176761
4160
# https://github.com/actions/setup-node/issues/1440#issuecomment-3705123143
4261
- name: Publish to NPM
43-
if: github.event_name == 'release'
4462
run: |
4563
unset NODE_AUTH_TOKEN
4664
npm publish

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [3.0.2] - 2026-04-17
6+
7+
### Fixed (3.0.2)
8+
9+
- **Apify**: Restore valid Actor input schema metadata by adding the missing nested alert channel descriptions required by Apify schema validation.
10+
- **Apify**: Reorder `signatureVerificationSecret` so it appears directly above `signatureVerification` in the Actor input UI while preserving the same backward-compatible runtime mapping.
11+
- **CI/CD**: Validate the Actor input schema with `apify validate-schema` alongside the web server schema so Apify build-time schema errors are caught before release.
12+
- **CI/CD**: Split npm validation from npm publishing so `id-token: write` is granted only during release publishing, and keep Docker PR validation tags limited to the single synthetic PR tag.
13+
- **CI/CD**: Normalize known flaky external link handling in the link check workflow by matching stable URL origin-and-path keys instead of full query-string URLs.
14+
- **Tooling**: Stop hardcoding the Apify CLI package version inside the validation script by invoking the project-installed `apify` binary instead.
15+
- **Tooling**: Add `@apify/input_secrets` as an explicit development dependency and align sync-version test fixtures with the production HTTP status key style.
16+
517
## [3.0.1] - 2026-04-15
618

719
### Fixed (3.0.1)
@@ -10,6 +22,8 @@ All notable changes to this project will be documented in this file.
1022
- **CI/CD**: Make the release-only npm and Docker workflows report successful pull request checks without publishing artifacts, so Dependabot PRs do not remain stuck waiting on required checks.
1123
- **CI/CD**: Make the required `Link Check` workflow run on every pull request so dependency-only PRs no longer remain stuck in an expected state when path filters skip the job.
1224
- **Apify**: Move the webhook signing secret to a top-level `signatureVerificationSecret` input with `isSecret: true`, while keeping runtime compatibility with older nested secret values.
25+
- **Forwarding**: Implement strict Content-Length parsing and enhance fallback logic in ForwardingService.
26+
- **GitHub/NPM**: Update CI/CD, `package.json` and `package-lock.json` to use the latest versions of various dependencies.
1327

1428
## [3.0.0] - 2026-04-02
1529

0 commit comments

Comments
 (0)