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

ruby-changes:59634

From: Takashi <ko1@a...>
Date: Mon, 6 Jan 2020 18:43:02 +0900 (JST)
Subject: [ruby-changes:59634] 8cd292f519 (master): Directly refer to GitHub events

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

From 8cd292f5195be094d67096174e688504897663b7 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Mon, 6 Jan 2020 01:42:30 -0800
Subject: Directly refer to GitHub events

instead of unnecessarily defining env vars

diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 39d0391..f68a448 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -27,12 +27,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L27
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
-          git -C src reset --hard "$GITHUB_REV"
-        env:
-          GITHUB_REV: ${{ github.event.pull_request.head.sha }}
-          GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
-          GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
+          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
+          git -C src reset --hard ${{ github.event.pull_request.head.sha }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
         id: commit_info
diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index 9615c00..af48f85 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -42,11 +42,10 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L42
           git clone --single-branch --shallow-since=yesterday https://github.com/ruby/ruby src
           git -C src reset --hard "$GITHUB_SHA"
         if: github.event_name == 'push'
-      # It's hard to propagate `env` to this workflow's shell environment to checkout PR. Using unstable actions/checkout as a workaround.
       - name: Checkout a pull request
-        uses: actions/checkout@v2
-        with:
-          path: src
+        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
+          git -C src reset --hard ${{ github.event.pull_request.head.sha }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
         shell: bash
diff --git a/.github/workflows/mjit.yml b/.github/workflows/mjit.yml
index 105639e..879b0c0 100644
--- a/.github/workflows/mjit.yml
+++ b/.github/workflows/mjit.yml
@@ -29,12 +29,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit.yml#L29
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
-          git -C src reset --hard "$GITHUB_REV"
-        env:
-          GITHUB_REV: ${{ github.event.pull_request.head.sha }}
-          GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
-          GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
+          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
+          git -C src reset --hard ${{ github.event.pull_request.head.sha }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
         id: commit_info
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 7669038..fbb23d1 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -60,12 +60,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L60
         if: github.event_name == 'push'
       - name: Checkout a pull request
         run: |
-          git clone --single-branch --shallow-since=yesterday "--branch=$GITHUB_BRANCH" "https://github.com/${GITHUB_REPO}" src
-          git -C src reset --hard "$GITHUB_REV"
-        env:
-          GITHUB_REV: ${{ github.event.pull_request.head.sha }}
-          GITHUB_BRANCH: ${{ github.event.pull_request.head.ref }}
-          GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }}
+          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
+          git -C src reset --hard ${{ github.event.pull_request.head.sha }}
         if: github.event_name == 'pull_request'
       - run: ./src/tool/actions-commit-info.sh
         id: commit_info
-- 
cgit v0.10.2


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

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