This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set a limit, helps with system outtages and can help avoid passing in a very long list of failed test to xcodebuild which would have the opposite effect | |
CCI_FAILED_TESTS_RERUN_LIMIT=11; | |
# $CIRCLECI_API_TOKEN is a CircleCI API token you presumably set in the project environment variables | |
if [[ -n "$CIRCLECI_API_TOKEN" && -n "$CIRCLE_SHA1" && -n "$CIRCLE_WORKFLOW_ID" ]]; then | |
pipeline_url="https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID" | |
echo "🤹🏼♂️ Fetching pipeline for $CIRCLE_WORKFLOW_ID" | |
pipeline=$( | |
curl -H "Circle-Token: $CIRCLECI_API_TOKEN" "$pipeline_url" | jq ' { pipeline_id: .pipeline_id, slug: .project_slug } ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env xcrun swift | |
import NaturalLanguage | |
let str = try! String(contentsOfFile: CommandLine.arguments[1]).trimmingCharacters(in: .whitespacesAndNewlines) | |
print("Analyzing commit message: '\(str)'") | |
if !str.first!.isUppercase { | |
print("\u{001B}[0;31mUppercase the first word of your commit message bro wtf") | |
exit(1) |