fix: allow latest versions to fallback to source#47
Conversation
🦋 Changeset detectedLatest commit: fa5c6e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Canary Packages PublishedLatest commit: fa5c6e3 Published 1 packages@hashicorp/platform-packer-plugins@0.3.0-canary-2022410192647 |
| publish: npm run release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }} |
There was a problem hiding this comment.
cc @brkalow has more context on this, I forgot the details of this despite going over it two minutes ago 😅
There was a problem hiding this comment.
Oops, we need to use a PAT instead of the GH actions token so our workflows can open PRs. A recent GitHub security fix restricted GH actions from being able to open PRs by default.
| const docsMdxFiles = docsEntries | ||
| .filter((e) => { | ||
| return path.extname(e.entryName) === '.mdx' | ||
| return isValidDocsContentPath(e.entryName) |
There was a problem hiding this comment.
Moves the filtering of content paths into one function. That's now where we determine whether a file is a valid content (now either .md or .mdx).
| * Return a string representing the latest release tag in that repo, | ||
| * or false if the latest tag cannot be resolved. | ||
| */ | ||
| export async function fetchLatestReleaseTag(repo: string): Promise<string> { |
There was a problem hiding this comment.
This is swiped from hashicorp/dev-portal. It allows us to resolve the latest version to an explicit tag.
| // and that there is at least one component subfolder | ||
| // with at least one .mdx file within it. | ||
| export function validatePluginDocsFiles(filePaths: string[]) { | ||
| function isValidPath(filePath: string) { |
There was a problem hiding this comment.
Moved into the is-valid-docs-file-path.ts util function.
|
@brkalow I've tested this out in hashicorp/dev-portal#413 & hashicorp/dev-portal#414. Right now it's working in combination with hashicorp/packer#11771 which has been merged in, intent being that once we've published this fix, and added it to Let me know what you think 🙇♂️ |
🎟️ Asana Task
Description
In brief, this PR resolves all latest version properties to specific tags as a first step in resolving plugin docs. See the
changesetsfile for details.PR Checklist 🚀