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

ruby-changes:59680

From: Kazuhiro <ko1@a...>
Date: Sat, 11 Jan 2020 16:24:54 +0900 (JST)
Subject: [ruby-changes:59680] e62aead269 (master): Add branch option to checkout on push

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

From e62aead26909e83f2c8b940186047f0a88b9f2d6 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Sat, 11 Jan 2020 16:24:16 +0900
Subject: Add branch option to checkout on push


diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml
index 0918ddb..b8360d4 100644
--- a/.github/workflows/cygwin.yml
+++ b/.github/workflows/cygwin.yml
@@ -44,10 +44,10 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/cygwin.yml#L44
       # 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
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 5cbcd44..d86f038 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -22,7 +22,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L22
       # 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
diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index 61b607c..cea26a5 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -39,9 +39,10 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L39
       # 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
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index 540dbb7..e773050 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -24,7 +24,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L24
       # 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
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 66d7065..7a40c24 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -55,7 +55,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L55
       # 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
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 3a4de23..82cca93 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -40,9 +40,10 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L40
       # 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
-- 
cgit v0.10.2


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

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