Directly refer to GitHub events

instead of unnecessarily defining env vars
This commit is contained in:
Takashi Kokubun 2020-01-06 01:42:30 -08:00
Родитель 7f1e3a7b7c
Коммит 8cd292f519
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 6FFC433B12EE23DD
4 изменённых файлов: 9 добавлений и 22 удалений

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

@ -27,12 +27,8 @@ jobs:
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

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

@ -42,11 +42,10 @@ jobs:
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

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

@ -29,12 +29,8 @@ jobs:
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

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

@ -60,12 +60,8 @@ jobs:
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