Skip to content

Added pre-commit hook to ensure API keys aren't committed#1756

Merged
NachoSoto merged 2 commits into
mainfrom
api-key-pre-commit-hook
Jul 25, 2022
Merged

Added pre-commit hook to ensure API keys aren't committed#1756
NachoSoto merged 2 commits into
mainfrom
api-key-pre-commit-hook

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Jul 11, 2022

Copy link
Copy Markdown
Contributor

Fixes CSDK-273.

@NachoSoto NachoSoto requested a review from a team July 11, 2022 18:54
Comment thread scripts/pre-commit.sh
Comment thread scripts/pre-commit.sh
"${SCRIPT_DIR}/../Examples/MagicWeather/MagicWeather/Constants.swift"
"${SCRIPT_DIR}/../Examples/MagicWeatherSwiftUI/Shared/Constants.swift"
)
PATTERN="\"REVENUECAT_API_KEY\""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This simply looks for this pattern.

Comment thread scripts/pre-commit.sh
Comment on lines +46 to +49
echo "Leftover API Key found in '$(basename $i)'. Please remove."
exit $FOUND

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And this is the output.

@NachoSoto NachoSoto changed the title Added pre-commit hook to ensure API keys aren't pushed Added pre-commit hook to ensure API keys aren't committed Jul 11, 2022

@aboedo aboedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

Comment thread scripts/pre-commit.sh
@NachoSoto NachoSoto force-pushed the api-key-pre-commit-hook branch from 3ad0798 to b2e92f7 Compare July 25, 2022 18:56
@NachoSoto NachoSoto merged commit ee2a561 into main Jul 25, 2022
@NachoSoto NachoSoto deleted the api-key-pre-commit-hook branch July 25, 2022 18:57
This was referenced Aug 1, 2022
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