summaryrefslogtreecommitdiff
path: root/.github/workflows/macos.yml
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-08-14 09:23:57 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-14 10:22:25 +0900
commit8a687b8a4ff4096d7783bed58642112cfa3256a0 (patch)
treedff37ecc101b7a07e1589f64db6e4db91e36da9c /.github/workflows/macos.yml
parent216d23008098c358d3a57cddc6f5d44e0b2f1602 (diff)
Stop using official actions/checkout
because it has been unstable, and also it sometimes does not work for a pull request like: https://github.com/ruby/ruby/pull/2358/checks?check_run_id=192685048#step:4:17
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2360
Diffstat (limited to '.github/workflows/macos.yml')
-rw-r--r--.github/workflows/macos.yml17
1 files changed, 13 insertions, 4 deletions
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 5cd7cc0aaa..2164acd484 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -21,10 +21,19 @@ jobs:
run: |
brew update
brew install gdbm gmp libffi openssl@1.1 zlib autoconf automake libtool readline
- - name: Checkout
- uses: actions/checkout@master
- with:
- fetch-depth: 50
+ # Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
+ - name: Checkout ruby/ruby
+ run: git clone --depth=50 https://github.com/ruby/ruby . && git reset --hard "$GITHUB_SHA"
+ env:
+ GITHUB_SHA: ${{ github.sha }}
+ if: github.event_name == 'push'
+ - name: Checkout a pull request
+ run: git clone --depth=50 "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" . && git reset --hard "$GITHUB_REV"
+ env:
+ GITHUB_REV: ${{ github.event.pull_request.head.sha }}
+ GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
+ GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
+ if: github.event_name == 'pull_request'
- name: Set ENV
run: |
echo '##[set-env name=JOBS]'-j$((1 + $(sysctl -n hw.activecpu)))