Skip to content
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

Support merge_group trigger #456

Closed
tenjaa opened this issue Apr 11, 2023 · 3 comments · May be fixed by #766
Closed

Support merge_group trigger #456

tenjaa opened this issue Apr 11, 2023 · 3 comments · May be fixed by #766
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tenjaa
Copy link

tenjaa commented Apr 11, 2023

When using this action with the new merge queue feature, I get the following error:

Error: Both a base ref and head ref must be provided, either via the `base_ref`/`head_ref` config options, or by running a `pull_request`/`pull_request_target` workflow.

It would be awesome, if this action can support the merge_group trigger out of the box.

@febuiles febuiles added enhancement New feature or request good first issue Good for newcomers labels May 8, 2023
@febuiles
Copy link
Contributor

febuiles commented May 8, 2023

@tenjaa thanks for opening an issue apologies it took almost a month to get to it.

After reading the docs it looks like we'd need to modify a bit how we fetch the base and head refs if the event is of type merge_group, we currently drop everything but pull_request and push).

@tenjaa
Copy link
Author

tenjaa commented May 8, 2023

I don't know where I got the workaround from but this in the end worked for me:

    - uses: actions/dependency-review-action@v2
      with:
        allow-licenses: MIT, Apache-2.0, ISC, BSD-2-Clause, 0BSD, NOASSERTION
        base-ref: ${{ github.event.pull_request.base.sha || 'main' }}
        head-ref: ${{ github.event.pull_request.head.sha || github.ref }}

@febuiles febuiles closed this as completed May 8, 2023
@febuiles
Copy link
Contributor

febuiles commented May 8, 2023

Thanks for the workaround example. I'm leaving this open and marked as "Good First Issue" so we can maybe get this supported as a first-class thing.

@febuiles febuiles reopened this May 8, 2023
magro added a commit to tomorrow-one/transactional-outbox that referenced this issue Jan 11, 2024
This e.g. failed: https://github.com/tomorrow-one/transactional-outbox/actions/runs/7494707648/job/20403300549#step:2:9

with `Error: Both a base ref and head ref must be provided, either via the `base_ref`/`head_ref` config options, or by running a `pull_request`/`pull_request_target` workflow.`

Workaround this issue following actions/dependency-review-action#456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants