Skip to content

Commit fca292f

Browse files
committed
refactor: checkout homebrew-core in action instead of script
This moves the git clone step from the `brew-bump.sh` script into the `npm-brew.yaml` as part of the job using actions/checkout instead.
1 parent a0561c7 commit fca292f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.github/workflows/npm-brew.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,19 @@ jobs:
4949
id: set-up-homebrew
5050
uses: Homebrew/actions/setup-homebrew@master
5151

52-
- uses: actions/checkout@v3
52+
- name: Checkout code-server
53+
uses: actions/checkout@v3
54+
55+
- name: Checkout coder/homebrew-core
56+
uses: actions/checkout@v3
57+
with:
58+
repository: coder/homebrew-core
59+
5360
- name: Configure git
5461
run: |
5562
git config user.name github-actions
5663
git config user.email github-actions@github.com
64+
5765
- name: Bump code-server homebrew version
5866
env:
5967
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}

ci/steps/brew-bump.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@ main() {
2121
exit 1
2222
fi
2323

24-
# NOTE: we need to make sure coderci/homebrew-core
25-
# is up-to-date
26-
# otherwise, brew bump-formula-pr will use an
27-
# outdated base
28-
echo "Cloning coderci/homebrew-core"
29-
git clone https://github.com/coderci/homebrew-core.git
30-
3124
# Make sure the git clone step is successful
32-
if directory_exists "homebrew-core"; then
25+
if ! directory_exists "homebrew-core"; then
3326
echo "git clone failed. Cannot find homebrew-core directory."
3427
ls -la
3528
exit 1
@@ -67,7 +60,7 @@ main() {
6760
echo 'echo $HOMEBREW_GITHUB_API_TOKEN' > "$PATH_TO_ASKPASS"
6861

6962
# Make sure the git-askpass.sh file creation is successful
70-
if file_exists "$PATH_TO_GIT_ASKPASS"; then
63+
if ! file_exists "$PATH_TO_GIT_ASKPASS"; then
7164
echo "git-askpass.sh not found in $HOME."
7265
ls -la "$HOME"
7366
exit 1
@@ -77,7 +70,7 @@ main() {
7770
chmod +x "$PATH_TO_GIT_ASKPASS"
7871

7972
# Make sure the git-askpass.sh file is executable
80-
if is_executable "$PATH_TO_GIT_ASKPASS"; then
73+
if ! is_executable "$PATH_TO_GIT_ASKPASS"; then
8174
echo "$PATH_TO_GIT_ASKPASS is not executable."
8275
ls -la "$PATH_TO_GIT_ASKPASS"
8376
exit 1

0 commit comments

Comments
 (0)