Add branch option to checkout on push
This commit is contained in:
parent
7584853cfe
commit
e62aead269
4
.github/workflows/cygwin.yml
vendored
4
.github/workflows/cygwin.yml
vendored
@ -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
|
||||
|
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@ -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
|
||||
|
3
.github/workflows/mingw.yml
vendored
3
.github/workflows/mingw.yml
vendored
@ -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
|
||||
|
2
.github/workflows/mjit.yml
vendored
2
.github/workflows/mjit.yml
vendored
@ -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
|
||||
|
2
.github/workflows/ubuntu.yml
vendored
2
.github/workflows/ubuntu.yml
vendored
@ -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
|
||||
|
3
.github/workflows/windows.yml
vendored
3
.github/workflows/windows.yml
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user