-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checkout on pull_request -> closed event #45
Comments
hi @luludan try to use another ref, by default, an example, referencing another ref: - uses: actions/checkout@v1
with:
ref: refs/heads/${{ github.head_ref }} # it could be ${{ github.base_ref }} also |
i'll play around with this, i think i might know a way. if you have the |
hi @ericsciple thanks for your support, here is a sample of name: Build
on:
pull_request:
branches:
- master
types: [opened, synchronize, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout PR Ref
if: github.event.action != 'closed'
uses: actions/checkout@v1
- name: Git Checkout Base Ref
if: github.event.pull_request.merged == true
uses: actions/checkout@v1
with:
ref: refs/heads/${{ github.base_ref }} |
@luludan v2 happens to fix the issue you were hitting. V2 fetches the specific SHA rather than the ref. This just works: on:
pull_request:
branches:
- master
types: [opened, synchronize, closed]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 |
@ericsciple I got an issue when using goveralls, mattn/goveralls#150
This can be fixed by using |
@fezho you can add event check: steps:
- uses: actions/checkout@v2
name: Checkout PR
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v2
name: Checkout Branch
if: github.event_name == 'push' |
Is there a way to checkout the code of a PR when closing the PR?
We are spinning up an environment per PR and need some config from the repo to help tear it down when closing the PR.
Currently it tries to checkout the branch based off the special github pr branch
The text was updated successfully, but these errors were encountered: