You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have a dev target branch and I want to set up a GH Action .yml file to run on every PR.
The first step,that is, the actions/checkout@v2 step, is no longer doing what it's supposed to. Which would be: checking out to the branch I'm wanting to merge.
name: Run tests
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
trigger-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Print current branch
run: echo "$(git branch)" # --> echoes "(HEAD detached at pull/<pr-number>/merge)"
For demonstration purposes:
I attach a side by side comparisson of the same pipeline run with a 4 days difference
I tried the same on another non related GH user and had the same error
Why is that? The same Print current branch step would print the actual name of the branch I'm trying to merge into dev a couple of days ago, but not anymore
The text was updated successfully, but these errors were encountered:
@Lucasmiguelmac by default the input ref will point to single commit
Setting fetch-depth: 0 can help pull all history and tags but it is not recommended if you have a large repo, therefore you can set the ref input like so to checkout the correct branch
Let's say I have a
dev
target branch and I want to set up a GH Action .yml file to run on every PR.The first step,that is, the
actions/checkout@v2
step, is no longer doing what it's supposed to. Which would be: checking out to the branch I'm wanting to merge.For demonstration purposes:
Why is that? The same
Print current branch
step would print the actual name of the branch I'm trying to merge intodev
a couple of days ago, but not anymoreThe text was updated successfully, but these errors were encountered: