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 for pull_request:close on base branch #110

Open
prescottprue opened this issue Jan 27, 2022 · 0 comments
Open

Support for pull_request:close on base branch #110

prescottprue opened this issue Jan 27, 2022 · 0 comments

Comments

@prescottprue
Copy link

prescottprue commented Jan 27, 2022

Currently base branch reporting requires a push event type. A number of workflows that our team has use the pull_request: closed event like so:

name: Merge to main

on:
  pull_request:
    types: [closed]
    branches:
      - main

jobs:
  deploy:
    name: deploy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v2
        with:
          node-version: 16.x
          cache: 'yarn'

      - run: yarn install --frozen-lockfile

      - run: yarn test --coverage --silent

      - uses: coverallsapp/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

I believe this could work with an override of the GITHUB_EVENT_NAME, but this can not be done through env variables, so it would be great to have an input to override the event type (so for closed PRs on the default branch it can be overriden) something like:

      - uses: coverallsapp/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          git-branch: 'main'
          event-type: 'push'

That way the setting of CI_PULL_REQUEST can be skipped.

It would be even better if this was handled without needing to pass input overrides, but the input can give us a way to test a bit before it is handled by default. Worth note that I also tried setting git-branch: 'main' with no luck (I think branch is being picked up correctly through GITHUB_REF).

In the meantime we will have to have duplicate workflows with the different event type just to upload coverage, which isn't ideal. Please let me know if you need any more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant