forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement signature check for Travis and AppVeyor (telegramdesktop#3295)
Signed-off-by: Christoph Auer <[email protected]>
- Loading branch information
Showing
6 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@echo off | ||
|
||
call:checkCommitMessage | ||
GOTO:EOF | ||
|
||
:checkCommitMessage | ||
call:logInfo "Commit message: %APPVEYOR_REPO_COMMIT_MESSAGE%" | ||
call:logInfo "Is pull request: %APPVEYOR_PULL_REQUEST_NUMBER%" | ||
|
||
if not "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" ( | ||
ECHO "%APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED%" | FINDSTR /C:"Signed-off-by: " >nul & IF ERRORLEVEL 1 ( | ||
call:logError "The commit message does not contain the signature!" | ||
call:logError "More information: https://github.com/telegramdesktop/tdesktop/blob/master/.github/CONTRIBUTING.md#sign-your-work" | ||
exit 1 | ||
) else ( | ||
call:logInfo "Commit message contains signature" | ||
|
||
:: Reset error level | ||
verify >nul | ||
) | ||
) | ||
GOTO:EOF | ||
|
||
:logInfo | ||
echo [INFO] %~1 | ||
GOTO:EOF | ||
|
||
:logError | ||
echo [ERROR] %~1 | ||
GOTO:EOF |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# Checks if the commit message contains the signature | ||
|
||
run() { | ||
checkCommitMessage | ||
} | ||
|
||
checkCommitMessage() { | ||
info_msg "Commit message: ${TRAVIS_COMMIT_MSG}"; | ||
info_msg "Is pull request: ${TRAVIS_PULL_REQUEST}"; | ||
|
||
if [[ $TRAVIS_PULL_REQUEST != "false" ]];then | ||
if [[ $TRAVIS_COMMIT_MSG != *"Signed-off-by: "* ]];then | ||
error_msg "The commit message does not contain the signature!" | ||
error_msg "More information: https://github.com/telegramdesktop/tdesktop/blob/master/.github/CONTRIBUTING.md#sign-your-work" | ||
exit 1 | ||
else | ||
success_msg "Commit message contains signature" | ||
fi | ||
fi | ||
} | ||
|
||
source ./.travis/common.sh | ||
|
||
run |
This file contains 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
This file contains 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