Skip to content

Conversation

@matejsemancik
Copy link
Member

This PR introduces a dedicated input for the GitHub token used by Danger in Android and KMP iOS workflows. This allows for more explicit control and potential customization of Danger's permissions. Workflows are updated to utilize a new GITHUB_TOKEN_DANGER secret.

Key Features:

  • Added github_token_danger input to the android-check action.
  • Updated android-check to use inputs.github_token_danger or fallback to github.token.
  • Configured android-cloud-check.yml to pass secrets.GITHUB_TOKEN_DANGER to the android-check action.
  • Modified ios-kmp-selfhosted-test.yml to use secrets.GITHUB_TOKEN_DANGER for the ios-fastlane-test action.

Token Usage Changes:

File Old Token Usage New Token Usage
.github/actions/android-check/action.yml github.token `inputs.github_token_danger
.github/workflows/android-cloud-check.yml (Implicit github.token via action) secrets.GITHUB_TOKEN_DANGER passed as github_token_danger input
.github/workflows/ios-kmp-selfhosted-test.yml secrets.GITHUB_TOKEN secrets.GITHUB_TOKEN_DANGER

This change introduces a dedicated input for a GitHub token to be used by Danger, enabling more granular permission control and improved security in CI workflows. It also updates the `ios-fastlane-test` action to use this dedicated token.
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ github.token }}
DANGER_GITHUB_API_TOKEN: ${{ inputs.github_token_danger || github.token }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken if you not pass token to Danger it will still use the "default one". It have build-in fallback logic to use github.token.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if I pass empty string? (I believe that non-existent input gets resolved into empty string)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well nvm let's try it that way

The Danger action should always use the `github_token_danger` input, removing the fallback to `github.token` to prevent authorization issues.
@matejsemancik matejsemancik merged commit 49828b5 into main Nov 12, 2025
1 check passed
@matejsemancik matejsemancik deleted the feature/android-danger-tokens branch November 12, 2025 09:38
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.

3 participants