[前][次][番号順一覧][スレッド一覧]

ruby-changes:60048

From: Takashi <ko1@a...>
Date: Thu, 13 Feb 2020 15:23:23 +0900 (JST)
Subject: [ruby-changes:60048] 7d42432546 (ruby_2_7): Support running Actions on a fork

https://git.ruby-lang.org/ruby.git/commit/?id=7d42432546

From 7d4243254629004007a390f7f1afc4a570a1fd00 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Mon, 6 Jan 2020 01:45:47 -0800
Subject: Support running Actions on a fork

Since 8c9450e7b875db846b19cc631af0d7fee66db5c6, 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.

diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml
index c7ea92b..59b70f7 100644
--- a/.github/workflows/cygwin.yml
+++ b/.github/workflows/cygwin.yml
@@ -42,9 +42,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/cygwin.yml#L42
         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
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index f68a448..ec2e631 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -20,9 +20,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L20
           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
diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index af48f85..51e258c 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -37,9 +37,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L37
           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
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index 879b0c0..2b923cf 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -22,9 +22,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L22
           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
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index fbb23d1..65a140c 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -53,9 +53,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L53
           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
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index cf4a4f6..357b3cf 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -38,9 +38,9 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L38
         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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]