-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Description
I wanted to run this action on pushes, so I needed to specify base-ref
and head-ref
. I wasn't sure how to do it, so I searched GitHub for uses. A few things there seemed not right, because they set the two refs to be the same, but they are a comparison, so don't they have to be different?
base-ref: ${{ github.event.pull_request.base.ref || github.ref }}
head-ref: ${{ github.event.pull_request.head.ref || github.ref }}
base-ref: main
head-ref: main
Others had more elaborate settings, but often hard-coded the base ref:
https://github.com/Infineon/ek-based-onboarding-optiga-tpm/blob/b00aefa07591394210d39fe306d704b52a23c270/.github/workflows/main.yml#L24-L25
head-ref: ${{ github.ref }}
base-ref: ec53ee4956ff702efdf1f7a06c87fdfe821dff0f
I used this:
base-ref: ${{ github.event.pull_request.base.ref || 'master' }}
head-ref: ${{ github.event.pull_request.head.ref || github.ref }}
What is the right way to do this? An example in the README would help people a lot I think.
Metadata
Metadata
Assignees
Labels
No labels