-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
ci: create placeholder file for new commands before validation #16771
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
const yamlDestPath = path.join('_data', `${{ inputs.data-files-folder }}`, yamlSrcFilename); | ||
const placeholderPath = path.join(dataFilesPlaceholderFolder, yamlSrcFilename.replace(/^docker_/, '').replace(/\.yaml$/, '.md')); | ||
if (dataFilesPlaceholderFolder !== '' && !fs.existsSync(placeholderPath)) { | ||
const placeholderContent = `---\ndatafolder: ${{ inputs.data-files-folder }}\ndatafile: ${yamlSrcFilename.replace(/\.[^/.]+$/, '')}\ntitle: ${yamlSrcFilename.replace(/\.[^/.]+$/, "").replaceAll('_', ' ')}\n---\n{% include cli.md datafolder=page.datafolder datafile=page.datafile %}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we split this up into multiple lines? Creating an array first, then joining with newlines?
It's a bit tricky to read at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we split this up into multiple lines?
👍
Didn't want to waste time with templating or handlebars for this stuff but we can look at this in follow-up to clean this up a bit.
Signed-off-by: CrazyMax <[email protected]>
40a2b9d
to
f5ea254
Compare
Proposed changes
Our
validate-upstream
workflow does not take into account new commands that don't have (yet) a placeholder markdown file and therefore fails with https://github.com/docker/buildx/actions/runs/4262324143/jobs/7417733008#step:8:3742This change ensures a placeholder exists and creates it if it's not there.
Tested here: https://github.com/docker/buildx/actions/runs/4263151955/jobs/7419575907#step:7:38
Related issues (optional)
debug-shell
andon-error
buildx#1640 (comment)