From 454cfbf949aea7af1d5e974e9c4e7b15022fab5f Mon Sep 17 00:00:00 2001 From: Audrey Sage Lorberfeld Date: Tue, 16 Jul 2024 16:53:17 -0700 Subject: [PATCH] Adjust build-docs/action to make /docs dir if it doesn't exist (#42) ## Problem Since `/docs` doesn't exist, the GH action `build-docs/action` cannot run. ## Solution Change file to check if `/docs` exists first; if it doesn't, create it; if it does, move on. ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [x] Infrastructure change (CI configs, etc) - [x] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan CI passes. --- .github/actions/build-docs/action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-docs/action.yml b/.github/actions/build-docs/action.yml index b305c7d..9d31485 100644 --- a/.github/actions/build-docs/action.yml +++ b/.github/actions/build-docs/action.yml @@ -4,6 +4,16 @@ runs: using: 'composite' steps: - name: Write html file to docs directory + shell: bash run: | + # Check if the ./docs directory exists + if [ -d "./docs" ]; then + echo "Directory ./docs exists." + else + echo "Directory ./docs does not exist. Creating it now..." + mkdir ./docs + fi + + # Run the godoc command godoc -url pkg/github.com/pinecone-io/go-pinecone/pinecone/ > ./docs/index.html - shell: bash \ No newline at end of file + echo "godoc command has been executed and the output has been saved to ./docs/index.html"