Skip to content

Return the GitHub App user id #148

Closed
@vleon1a

Description

@vleon1a

Hello,

The action returns additional outputs thanks to #105, but it would be great to return also the GitHub App user id, which we can fetch using the GH CLI for instance with gh api "/users/<app-slug>[bot]" --jq .id.
The rationale is that to get the commit authenticated properly, we have to use the user id and not the installation id (as also mentioned in this discussion. This was discussed in the mentioned PR, but somehow only the installation id was added to the outputs.

This is currently how I implemented it:

      - name: Generate GitHub App Token
        id: generate-token
        uses: actions/create-github-app-token@c8f55efbd427e7465d6da1106e7979bc8aaee856 # v1.10.1
        with:
          app-id: ${{ secrets.SEMANTIC_RELEASE_APP_ID }}
          private-key: ${{ secrets.SEMANTIC_RELEASE_PRIVATE_KEY }}
      - name: GitHub Release
        env:
          GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
          GIT_AUTHOR_NAME: ${{ steps.generate-token.outputs.app-slug }}[bot]
          GIT_AUTHOR_EMAIL: ${{ steps.generate-token.outputs.installation-id }}+${{ steps.generate-token.outputs.app-slug }}[bot]@users.noreply.github.com
          GIT_COMMITTER_NAME: ${{ steps.generate-token.outputs.app-slug }}[bot]
          GIT_COMMITTER_EMAIL: ${{ steps.generate-token.outputs.installation-id }}+${{ steps.generate-token.outputs.app-slug }}[bot]@users.noreply.github.com
        run: npx semantic-release

Which leads to commits not properly associated with the GitHub App. So we would need to use the user-id instead of the installation-id in the email

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions