mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 09:41:41 -05:00
Remove the check for "Signed-of-by" at PR
This commit is contained in:
parent
f619afc4c6
commit
e83dd2037a
2 changed files with 0 additions and 59 deletions
|
@ -60,8 +60,6 @@ addons:
|
|||
- yasm
|
||||
|
||||
before_install:
|
||||
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
|
||||
- .travis/check.sh
|
||||
- export CXX="g++-6" CC="gcc-6"
|
||||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
|
||||
- sudo update-alternatives --config gcc
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Checks commit message, ...
|
||||
|
||||
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"
|
||||
addMissingSignatureInfos
|
||||
exit 1
|
||||
else
|
||||
success_msg "Commit message contains signature"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
addMissingSignatureInfos() {
|
||||
if [[ $BUILD_VERSION == "" ]]; then
|
||||
local TEXT="Hi,\n\
|
||||
thanks for the pull request!\n\
|
||||
\n\
|
||||
Please read our [contributing policy](https://github.com/telegramdesktop/tdesktop/blob/master/.github/CONTRIBUTING.md). You'll need to make a pull request with the \\\"Signed-off-by:\\\" signature being the last line of your commit message, like it is described in [sign your work](https://github.com/telegramdesktop/tdesktop/blob/master/.github/CONTRIBUTING.md#sign-your-work) section. That will grant your work into the public domain.\n\
|
||||
\n\
|
||||
(See [travis build](https://travis-ci.org/telegramdesktop/tdesktop/jobs/${TRAVIS_JOB_ID}))"
|
||||
addCommentToGitHub "${TEXT}"
|
||||
addLabelToGitHub "missing signature"
|
||||
info_msg "Added missing signature info on github"
|
||||
fi
|
||||
}
|
||||
|
||||
addCommentToGitHub() {
|
||||
local BODY=$1
|
||||
sendGitHubRequest "POST" "{\"body\": \"${BODY}\"}" "repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments"
|
||||
}
|
||||
|
||||
addLabelToGitHub() {
|
||||
local LABEL=$1
|
||||
sendGitHubRequest "PATCH" "{\"labels\": [\"${LABEL}\"]}" "repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}"
|
||||
}
|
||||
|
||||
sendGitHubRequest() {
|
||||
local METHOD=$1
|
||||
local BODY=$2
|
||||
local URI=$3
|
||||
curl -H "Authorization: token ${GH_AUTH_TOKEN}" --request "${METHOD}" --data "${BODY}" --silent "https://api.github.com/${URI}" > /dev/null
|
||||
}
|
||||
|
||||
source ./.travis/common.sh
|
||||
|
||||
run
|
Loading…
Add table
Reference in a new issue