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

GH Actions: special case Dependabot PRs for Coveralls #250

Merged
merged 1 commit into from Jul 15, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 15, 2023

Follow up on PR #227.

Turns out Dependabot PRs do not have access to secrets with the exception of (read-only) access to the GITHUB_TOKEN.

As the coverage test runs and the Coveralls status are required builds, this blocks Dependabot PRs from being merged without overruling the required statuses.

As I'd like to avoid that situation, I'm special casing Dependabot PRs for the token selection.

Unfortunately using a condition like ${{ github.actor != 'dependabot[bot]' || secrets.COVERALLS_TOKEN && secrets.GITHUB_TOKEN }} won't work when it involves secrets, so we need to use duplicate steps to get round this.

Refs:

Follow up on PR 227.

Turns out Dependabot PRs do not have access to secrets with the exception of (read-only) access to the `GITHUB_TOKEN`.

As the coverage test runs and the Coveralls status are required builds, this blocks Dependabot PRs from being merged without overruling the required statuses.

As I'd like to avoid that situation, I'm special casing Dependabot PRs for the token selection.

Unfortunately using a condition like `${{ github.actor != 'dependabot[bot]' || secrets.COVERALLS_TOKEN && secrets.GITHUB_TOKEN }}` won't work when it involves secrets, so we need to use duplicate steps to get round this.

Refs:
* lemurheavy/coveralls-public 1721
* https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events
@jrfnl jrfnl added this to the 1.1.0 milestone Jul 15, 2023
@jrfnl jrfnl enabled auto-merge July 15, 2023 12:17
@jrfnl jrfnl merged commit 7a63da0 into develop Jul 15, 2023
37 checks passed
@jrfnl jrfnl deleted the feature/ghactions-use-github-token-for-dependabot branch July 15, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant