Remove circular dependency in API sample generation #1906
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1792
Let's just source these samples directly from the generated files. That way, they'll always work even if the site is down.
Note: for
formula.json
, it's a little more tricky because the generated file is actually a template that is only expanded after the site is generated. Instead, just modify theformula/wget.json
file to match the syntax that would be used in the larger file (indent, add surrounding brackets, and remove the analytics).For the "docs" workflow, we currently generate the API samples to run the API docs page through
HTMLProofer
. As far as I can tell, this just checks for broken links and malformed content, so we can just put template contents in for the sake of this check. This avoids the hassle of actually generating the API files or importing them from a separate actions run when we don't need to.And, while I'm here, let's add explicit
contents: read
permissions to the workflows that don't have them defined.