Script to find GitHub repositories that contain FSH code.
Git repositories containing FHIR Implementation Guides are found from the following sources:
- FHIR continuous integration build list
- Specific GitHub organizations/users known to contain IGs (see
RepoSourceGitHubOrgsinlib/repo_sources.rb) - A static list of manually defined repos (see
RepoSourceStaticinlib/repo_sources.rb)
FSH is identified by looking for the presence of the following folders in any branch of the repository that is public on GitHub:
- FSH supporting SUSHI >= 1.0:
/input/fsh/ - FSH supporting SUSHI < 1.0:
/fsh/
FSH language features (instantiation of Profiles, Instances, OperationDefinition instances, and StructureDefinition instances) only include the primary branch in the IG's GitHub repository. This is due to the GitHub search API only indexing the primary branch. See lib/features.rb for details.
-
Clone this repo locally.
-
Run
bundle installfrom the root of the repo. -
Copy
env.exampleto.env, get a personal access token for GitHub, and put that along with your username into.env. This is necessary to avoid aggressive rate limiting for unauthenticated users with the GitHub search API. -
Run
script/run, which will populate thegenerated/folder with output:generated/index.htmlis the main product of the script; based ontemplate.liquidgenerated/fshy_repos.txtis a list of the GitHub URLs for repos using FSHgenerated/cache.jsonis a structured representation of the data used to createindex.html
Note that a clean run of
script/runcan take >10 minutes.
By default script/run will use generated/cache.json if it exists rather than re-querying the GitHub API on every run. This allows for iterative modifications to index.html. Run script/clean to remove the cache and other contents of generated/.
Run script/publish.
Copyright 2020 The MITRE Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.