Skip to content

Harden upload.sh and add bats tests - #4

Merged
davidnewhall merged 1 commit into
mainfrom
pr1-harden-upload
Aug 24, 2026
Merged

davidnewhall merged 1 commit into
mainfrom
pr1-harden-upload

Conversation

@davidnewhall

@davidnewhall davidnewhall commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite upload.sh to drop sudo gem install, quote paths, and fail on missing token/file or empty package folders (deb-only folders still succeed).
  • Add bats coverage for the upload matrix and a test-and-lint workflow (bats + shellcheck).
  • Bump LICENSE to 2022-2026 and fix README typos; document that @v1 / @v1.N float from a vN.N.N tag.

Test plan

  • shellcheck upload.sh
  • bats test (10 cases)
  • CI bats and shellcheck jobs on this PR

Made with Cursor

…ts CI.

Consumers pinning @v1 currently skip the nullglob fix; quoting, token checks, and tests make the next floating tag safe to cut.

Co-authored-by: Cursor <cursoragent@cursor.com>
@davidnewhall
davidnewhall merged commit 9d227b6 into main Aug 24, 2026
2 checks passed
@davidnewhall
davidnewhall deleted the pr1-harden-upload branch August 24, 2026 23:54
@golift-bot
golift-bot requested a balanced review from Copilot August 24, 2026 23:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens package uploads and adds automated shell validation.

Changes:

  • Improves validation, quoting, CLI installation, and upload routing.
  • Adds Bats tests and shellcheck CI jobs.
  • Updates documentation and license dates.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
upload.sh Hardens upload execution and validation.
test/upload.bats Adds upload behavior tests.
.github/workflows/codetests.yml Runs Bats and shellcheck in CI.
README.md Fixes typos and documents floating tags.
LICENSE Updates the copyright range.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/upload.bats

cat > "${BIN}/package_cloud" <<'EOF'
#!/usr/bin/env bash
printf '%s\n' "$*" >> "${PACKAGECLOUD_LOG}"
Comment thread test/upload.bats
Comment on lines +12 to +15
cat > "${BIN}/package_cloud" <<'EOF'
#!/usr/bin/env bash
printf '%s\n' "$*" >> "${PACKAGECLOUD_LOG}"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants