2
2
set -euo pipefail
3
3
4
4
main () {
5
- REPO=" homebrew-core"
6
- GITHUB_USERNAME=" cdrci"
7
- UPSTREAM_USERNAME_AND_REPO=" Homebrew/$REPO "
8
5
# Only sourcing this so we get access to $VERSION
9
6
source ./ci/lib.sh
10
7
source ./ci/steps/steps-lib.sh
@@ -23,68 +20,6 @@ main() {
23
20
exit 1
24
21
fi
25
22
26
- # Make sure the git clone step is successful
27
- if ! directory_exists " $REPO " ; then
28
- echo " git clone failed. Cannot find $REPO directory."
29
- ls -la
30
- exit 1
31
- fi
32
-
33
- echo " Changing into $REPO directory"
34
- pushd " $REPO " && pwd
35
-
36
- echo " Adding $UPSTREAM_USERNAME_AND_REPO "
37
- git remote add upstream " https://github.com/$UPSTREAM_USERNAME_AND_REPO .git"
38
-
39
- # Make sure the git remote step is successful
40
- if ! git config remote.upstream.url > /dev/null; then
41
- echo " git remote add upstream failed."
42
- echo " Could not find upstream in list of remotes."
43
- git remote -v
44
- exit 1
45
- fi
46
-
47
- # TODO@jsjoeio - can I somehow check that this succeeded?
48
- echo " Fetching upstream $UPSTREAM_USERNAME_AND_REPO commits"
49
- git fetch upstream master
50
-
51
- # TODO@jsjoeio - can I somehow check that this succeeded?
52
- echo " Merging in latest $UPSTREAM_USERNAME_AND_REPO changes branch master"
53
- git merge upstream/master
54
-
55
- # GIT_ASKPASS lets us use the password when pushing without revealing it in the process list
56
- # See: https://serverfault.com/a/912788
57
- PATH_TO_GIT_ASKPASS=" $HOME /git-askpass.sh"
58
- # Source: https://serverfault.com/a/912788
59
- # shellcheck disable=SC2016,SC2028
60
- echo ' echo $HOMEBREW_GITHUB_API_TOKEN' > " $PATH_TO_GIT_ASKPASS "
61
-
62
- # Make sure the git-askpass.sh file creation is successful
63
- if ! file_exists " $PATH_TO_GIT_ASKPASS " ; then
64
- echo " git-askpass.sh not found in $HOME ."
65
- ls -la " $HOME "
66
- exit 1
67
- fi
68
-
69
- # Ensure it's executable since we just created it
70
- chmod +x " $PATH_TO_GIT_ASKPASS "
71
-
72
- # Make sure the git-askpass.sh file is executable
73
- if ! is_executable " $PATH_TO_GIT_ASKPASS " ; then
74
- echo " $PATH_TO_GIT_ASKPASS is not executable."
75
- ls -la " $PATH_TO_GIT_ASKPASS "
76
- exit 1
77
- fi
78
-
79
- # NOTE: we need to make sure our fork is up-to-date
80
- # otherwise, brew bump-formula-pr will use an
81
- # outdated base
82
- echo " Pushing changes to $GITHUB_USERNAME /$REPO fork on GitHub"
83
- # Export the variables so git sees them
84
- export HOMEBREW_GITHUB_API_TOKEN=" $HOMEBREW_GITHUB_API_TOKEN "
85
- export GIT_ASKPASS=" $PATH_TO_GIT_ASKPASS "
86
- git push " https://$GITHUB_USERNAME @github.com/$GITHUB_USERNAME /$REPO .git" --all
87
-
88
23
# Find the docs for bump-formula-pr here
89
24
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18
90
25
local output
0 commit comments