stripe / react-stripe-js

React components for Stripe.js and Stripe Elements
https://stripe.com/docs/stripe-js/react
MIT License
1.75k stars 267 forks source link

update publish script #433

Closed pololi-stripe closed 1 year ago

pololi-stripe commented 1 year ago

Summary & motivation

update publish script

API review

Copy [this template] or link to an API review issue.

[this template]: https://github.com/stripe/react-stripe-js/tree/master/.github/API_REVIEW.md

Testing & documentation

pololi-stripe commented 1 year ago

test for verify_commit_is_signed function

I added a tmp.sh

verify_commit_is_signed() {
  local commit_hash=$(git log -1 --format="%H")

  if ! git verify-commit "$commit_hash" &> /dev/null; then
    echo "Error! Commit $commit_hash is not signed"
    echo "Please follow https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account and sign your commit"
    exit 1
  fi
}

verify_commit_is_signed

echo "latest commit is signed!"
echo ""

verify_commit_is_signed_foo() {
  local commit_hash="c5d1ef34dc452ac8c8f61e2b3685ff781da8fbdc"

  if ! git verify-commit "$commit_hash" &> /dev/null; then
    echo "Error! Commit $commit_hash is not signed"
    echo "Please follow https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account and sign your commit"
    exit 1
  fi
}

verify_commit_is_signed_foo

and ran it

~/stripe-oss/stripe-js
> ./tmp.sh 
latest commit is signed!

Error! Commit c5d1ef34dc452ac8c8f61e2b3685ff781da8fbdc is not signed
Please follow https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account and sign your commit