-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: check for existing pull request before auto build-push-pr
Signed-off-by: Jérôme Jutteau <jerome.jutteau@outscale.com>
- Loading branch information
1 parent
d6ba26b
commit 5f13c0e
Showing
2 changed files
with
29 additions
and
1 deletion.
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,24 @@ | ||
#!/bin/env bash | ||
set -e | ||
|
||
root=$(cd "$(dirname $0)/../.." && pwd) | ||
# build new version number | ||
local_sdk_version=$(cat $root/sdk_version) | ||
local_sdk_version_major=$(echo $local_sdk_version | cut -d '.' -f 1) | ||
local_sdk_version_minor=$(echo $local_sdk_version | cut -d '.' -f 2) | ||
new_sdk_version_minor=$(( local_sdk_version_minor + 1 )) | ||
new_sdk_version="$local_sdk_version_major.$new_sdk_version_minor.0" | ||
|
||
branch_name="autobuild-$new_sdk_version" | ||
|
||
if [ -z "$GH_TOKEN" ]; then | ||
echo "GH_TOKEN is missing, abort." | ||
exit 1 | ||
fi | ||
|
||
result=$(curl -s -u LolUserName:$GH_TOKEN "https://api.github.com/repos/outscale/osc-sdk-go/pulls" | jq ".[] | select(.title == \"$new_sdk_version version\") | .title") | ||
|
||
if [ ! -z "$result" ]; then | ||
echo "Pull request seems to alread exist, abort." | ||
exit 1 | ||
fi |
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