Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert changes in validate script that broke versioning #178

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
198 changes: 0 additions & 198 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"devDependencies": {
"ajv": "^8.17.1",
"ajv-formats": "^3.0.1",
"execa": "^9.3.0",
"glob": "^9.0.1",
"husky": "^9.1.1",
"lint-staged": "^15.2.7",
Expand Down
19 changes: 0 additions & 19 deletions validate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ import Ajv from 'ajv/dist/2020.js'
import addFormats from 'ajv-formats'
import meta from 'ajv/dist/refs/json-schema-2020-12/index.js'
import { glob as baseGlob } from 'glob'
import { execa, ExecaError } from 'execa'

let ref
try {
const { stdout } = await execa`git describe --tags --abbrev=0`
ref = stdout
} catch (e) {
if (e instanceof ExecaError && e.failed) ref = 'main'
else throw e
}

const schemaIdPrefix = `https://gcn.nasa.gov/schema/${ref}`

const ajv = new Ajv({
validateSchema: true,
Expand All @@ -39,13 +27,6 @@ async function validate() {
encoding: 'utf-8',
}),
)
const expectedId = `${schemaIdPrefix}/${match}`
if (json['$id'] !== expectedId) {
console.error(
`error: ${match}: expected value of $id to be ${expectedId}, but found ${json['$id']}`,
)
process.exitCode = 1
}
return json
}),
)
Expand Down