aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ubuntu.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/ubuntu.yml')
-rw-r--r--.github/workflows/ubuntu.yml17
1 files changed, 13 insertions, 4 deletions
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index d7a6cbadda..44dfac56a7 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -20,10 +20,19 @@ jobs:
sudo apt-get update
sudo apt-get install ruby2.5
sudo apt-get build-dep ruby2.5
- - 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: |
export JOBS=-j$((1 + $(nproc --all)))