Skip to content

Commit

Permalink
Merge pull request #201 from ulucinar/fix-errcheck
Browse files Browse the repository at this point in the history
[updoc] Check for errors while walking the filesystem
  • Loading branch information
ulucinar committed Apr 5, 2024
2 parents 99b7058 + 3ed43bd commit f2ad7dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/provider-updoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ on:
default: '1.20'
required: false
type: string
updoc-version:
description: 'updoc version to use while publishing the documentation'
default: '21481764'
required: false
type: string
secrets:
UPBOUND_CI_PROD_BUCKET_SA:
required: true

env:
UPTEST_VERSION: "83bd901"

jobs:
publish-docs:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -78,7 +80,7 @@ jobs:
DOCS_DIR="./docs/family"
fi
echo "Publishing Docs for ${PROVIDER_PACKAGE_NAME}, ${{ env.VER_MAJOR_MINOR }} from $DOCS_DIR"
go run github.com/upbound/uptest/cmd/updoc@${{ env.UPTEST_VERSION }} upload --docs-dir="${DOCS_DIR}" --name="${PROVIDER_PACKAGE_NAME}" --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io
go run github.com/upbound/uptest/cmd/updoc@${{ inputs.updoc-version }} upload --docs-dir="${DOCS_DIR}" --name="${PROVIDER_PACKAGE_NAME}" --version=${{ env.VER_MAJOR_MINOR }} --bucket-name=bucket-marketplace-docs-production --cdn-domain=https://user-content.upbound.io
done
else
echo "This job can only be run on release branches"
Expand Down
3 changes: 3 additions & 0 deletions internal/updoc/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ func (u *UploadManager) getIndex(afs afero.Fs, dir string, meta map[string]strin
func (u *UploadManager) getMeta(ctx context.Context, bucket *storage.BucketHandle, cdn string, afs afero.Fs, dir string) (map[string]string, error) {
meta := make(map[string]string)
if err := afero.Walk(afs, dir, func(p string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
if info.Name() == indexFN || info.Name() == sectionFN {
return nil
Expand Down

0 comments on commit f2ad7dd

Please sign in to comment.