1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add branch option to checkout on push

This commit is contained in:
Kazuhiro NISHIYAMA 2020-01-11 16:24:16 +09:00
parent 7584853cfe
commit e62aead269
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A
6 changed files with 9 additions and 7 deletions

View file

@ -44,10 +44,10 @@ jobs:
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
git -C src reset --hard ${{ github.sha }}
if: github.event_name == 'push'
shell: cmd
shell: bash
- name: Checkout a pull request
run: |
git clone --single-branch --shallow-since=yesterday --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src

View file

@ -22,7 +22,7 @@ jobs:
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

View file

@ -39,9 +39,10 @@ jobs:
# Not using official actions/checkout@v2 because it's unstable.
- name: Checkout ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
shell: bash
- name: Checkout a pull request
run: |
git clone --single-branch --shallow-since=yesterday --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src

View file

@ -24,7 +24,7 @@ jobs:
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

View file

@ -55,7 +55,7 @@ jobs:
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

View file

@ -40,9 +40,10 @@ jobs:
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git clone --single-branch --shallow-since=yesterday --branch=${GITHUB_REF#refs/heads/} https://github.com/${{ github.repository }} src
git -C src reset --hard ${{ github.sha }}
if: github.event_name == 'push'
shell: bash
- name: Checkout a pull request
run: |
git clone --single-branch --shallow-since=yesterday --branch=${{ github.event.pull_request.head.ref }} https://github.com/${{ github.event.pull_request.head.repo.full_name }} src