Files
cypress/scripts/format-workflow-file.js
Bill Glesias fec6912cf9 chore: move browser-versions.json values straight into the workflow yaml (#30989)
* use env variables in yaml [run ci]

* add husky hook to lint-staged to format the circle workflow file on commit when the file changes to keep the diff from the github actions job short

* chore: cut over browser-version scripts from json to yaml to update the workflow file inline

* Update scripts/format-workflow-file.js

Co-authored-by: Matt Schile <mschile@cypress.io>

* move expected yaml keys to const variables

---------

Co-authored-by: Matt Schile <mschile@cypress.io>
2025-02-05 13:53:04 -05:00

18 lines
526 B
JavaScript

const fs = require('fs')
const yaml = require('yaml')
/**
* from root of directory run:
* node ./scripts/format-workflow-file.js
*
* This script is also executed as a pre-commit hook in husky to ensure the workflow file is always formatted correctly
*/
const formatWorkflowFile = () => {
// file path is relative to repo root
const doc = yaml.parseDocument(fs.readFileSync('./.circleci/workflows.yml', 'utf8'))
fs.writeFileSync('./.circleci/workflows.yml', yaml.stringify(doc), 'utf8')
}
formatWorkflowFile()