# This testcase is an attempt to implement:
# https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#signature-verification-for-bots
# See also: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#signature-verification-for-bots

# We want all the activities of this script to be performed
# by The Power's Tiny GitHub App so we first get a GitHub App Token 
# to override the token in the config:
GITHUB_TOKEN=$(./tiny-call-get-installation-token.sh | jq -r '.token')
# pass the GITHUB_TOKEN to all the scripts below:


echo "Creating a tree:" 
echo "===================="
./tiny-app-codesign-create-a-tree.sh ${GITHUB_TOKEN} > tmp/tiny-app-codesign-create-a-tree-response.json
echo "Creating a commit:" 
echo "===================="
./tiny-app-codesign-create-a-commit.sh ${GITHUB_TOKEN} > tmp/tiny-app-codesign-create-a-commit-response.json
echo "Updating a reference:" 
echo "===================="
./tiny-app-codesign-update-a-reference.sh ${GITHUB_TOKEN}
