зеркало из https://github.com/github/ruby.git
Directly refer to GitHub events
instead of unnecessarily defining env vars
This commit is contained in:
Родитель
7f1e3a7b7c
Коммит
8cd292f519
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче