Support running Actions on a fork

Since 8c9450e7b8, we increased the chance
to run GitHub Actions on a fork, as we usually use a topic branch
instead of master when filing a pull request.

This patch makes it possible to reuse the same GitHub Actions config on
a fork repository.
This commit is contained in:
Takashi Kokubun 2020-01-06 01:45:47 -08:00
Родитель 8cd292f519
Коммит e3aca28970
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 6FFC433B12EE23DD
6 изменённых файлов: 12 добавлений и 12 удалений

4
.github/workflows/cygwin.yml поставляемый
Просмотреть файл

@ -42,9 +42,9 @@ jobs:
run: |
echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby/ruby
- name: Checkout push to ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git -C src reset --hard ${{ github.sha }}
if: github.event_name == 'push'
shell: cmd

4
.github/workflows/macos.yml поставляемый
Просмотреть файл

@ -20,9 +20,9 @@ jobs:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby/ruby
- name: Checkout push to ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

4
.github/workflows/mingw.yml поставляемый
Просмотреть файл

@ -37,9 +37,9 @@ jobs:
git config --system core.autocrlf false
git config --system core.eol lf
# Not using official actions/checkout@v2 because it's unstable.
- name: Checkout ruby/ruby
- name: Checkout push to ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

4
.github/workflows/mjit.yml поставляемый
Просмотреть файл

@ -22,9 +22,9 @@ jobs:
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby/ruby
- name: Checkout push to ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

4
.github/workflows/ubuntu.yml поставляемый
Просмотреть файл

@ -53,9 +53,9 @@ jobs:
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby/ruby
- name: Checkout push to ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git -C src reset --hard "$GITHUB_SHA"
if: github.event_name == 'push'
- name: Checkout a pull request

4
.github/workflows/windows.yml поставляемый
Просмотреть файл

@ -38,9 +38,9 @@ jobs:
run: |
choco install --no-progress openssl winflexbison3
# Not using official actions/checkout because it's unstable and sometimes doesn't work for a fork.
- name: Checkout ruby/ruby
- name: Checkout push to ruby
run: |
git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
git clone --single-branch --shallow-since=yesterday https://github.com/${{ github.repository }} src
git -C src reset --hard ${{ github.sha }}
if: github.event_name == 'push'
- name: Checkout a pull request