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

Add build number to supported inputs options #228

Merged
merged 5 commits into from
Oct 11, 2024
Merged

Conversation

afinetooth
Copy link
Member

@afinetooth afinetooth commented Oct 11, 2024

Description

Let users substitute an alternate build number for the default build number: S{{ github.run_id }} .

  • Add build-number to input options and pass it to the binary.
  • Add a test to verify --build-number is correctly passed to coverage-reporter

Contributed by

Alternative Approach: Coveralls Environment Variables

Please note that substituting key input values, like build number (aka. service_number), so they are passed to the coverage-reporter binary from this github-action, is always possible through the use of Coveralls Environment Variables.

To substitute build number, use COVERALLS_SERVICE_NUMBER in your step config:

  • Example: commit sha: - A common alternative to ${{ github.run_id }} that can be used to tie several GitHub Actions workflows together at Coveralls is commit sha (${{ github.sha }}), so a configuration like the one below will override the default (${{ github.run_id }}):

Parallel upload step:

    - name: Coveralls Parallel Upload
      uses: coverallsapp/github-action@v2
      env:
        COVERALLS_SERVICE_NUMBER: ${{ github.sha }} # default: ${{ github.run_id }}
      with:
        parallel: true
        flag_name: my-flag-name-1

In the case of this substitution, make sure you also pass it to the "Parallel finished" step, which requires the build number to find your build at Coveralls:

Parallel finished step:

    - name: Coveralls Finished
      uses: coverallsapp/github-action@v2
      env:
        COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
      with:
        parallel-finished: true
        carryforward: "my-flag-name-1,my-flag-name-2"

@afinetooth afinetooth merged commit c258231 into main Oct 11, 2024
24 checks passed
@afinetooth afinetooth deleted the pr-199-changes branch October 11, 2024 23:37
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

Successfully merging this pull request may close these issues.

2 participants