docs: added hook sample (#1462)

* docs: added hook sample

* docs: changed default value to DEFAULT_API_KEY
This commit is contained in:
Enrique López Mañas 2024-01-26 18:51:18 +01:00 committed by GitHub
parent 8caba9ce7b
commit 588287af6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 28 additions and 23 deletions

View File

@ -42,10 +42,6 @@ jobs:
distribution: 'adopt'
java-version: '17'
- name: Uninstall NDK
run: |
sudo ${ANDROID_HOME}/tools/bin/sdkmanager --uninstall 'ndk-bundle'
- name: Build and check
run: |
cd ApiDemos
@ -80,10 +76,6 @@ jobs:
distribution: 'adopt'
java-version: '17'
- name: Uninstall NDK
run: |
sudo ${ANDROID_HOME}/tools/bin/sdkmanager --uninstall 'ndk-bundle'
- name: Build and check
run: |
cd snippets

View File

@ -57,3 +57,6 @@ jobs:
body: |
Generating V3 code via `./gradlew generateV3 generateV3Layout`
branch: googlemaps-bot/generate-v3
- name: Uninstall NDK
run: |
${ANDROID_HOME}/tools/bin/sdkmanager --uninstall 'ndk-bundle'

View File

@ -32,10 +32,6 @@ jobs:
distribution: 'temurin'
java-version: '17'
- name: Uninstall NDK
run: |
sudo ${ANDROID_HOME}/tools/bin/sdkmanager --uninstall 'ndk-bundle'
- name: Build APKs
run: |
echo "Generating ApiDemos (Java) APKs"

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
GOOGLE_MAPS_API_KEY=STUB_API_KEY
GOOGLE_MAPS_API_KEY=DEFAULT_API_KEY

14
hooks/pre-commit Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
## This hook provides an example that prevents the API Key from being committed.
## The file can be adapted to your needs, but ultimately this hook will reject the commit if the MAPS_API_KEY
## has been modified. Git Hooks are located in the folder .git/hooks
FILE="local.defaults.properties"
if ! grep -q "^MAPS_API_KEY=DEFAULT_API_KEY" "$FILE"; then
echo "Error: Commit rejected. Invalid content in $FILE."
exit 1
fi
exit 0

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1,2 +1,2 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY
PLACES_API_KEY=YOUR_API_KEY

View File

@ -5,4 +5,4 @@
# For customization when using a Version Control System, please read the
# header note.
#Mon Apr 06 10:50:09 PDT 2020
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY

View File

@ -1 +1 @@
MAPS_API_KEY=STUB_API_KEY
MAPS_API_KEY=DEFAULT_API_KEY