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 compiled credentials to outputs #137

Closed
wants to merge 1 commit into from

Conversation

iamstarkov
Copy link

This is the iteration of #105

I'd like to have compiled credentials as an output. I'm not sure about commiter, it's just how I'll be using it. Perhaps credentials is a better name?

My use case is that the following quite lengthy:

  - uses: org/gitops@v2
    with:
      github-token: ${{ steps.app-auth.outputs.token }}
      repo: gitops-repo
      commiter: "${{steps.app-auth.outputs.app-slug}}[bot] <${{ steps.app-auth.outputs.installation-id }}+${{ steps.app-auth.outputs.app-slug }}[bot]@users.noreply.github.com"

And I'd like to use something less verbose, like this:

  - uses: org/gitops@v2
    with:
      github-token: ${{ steps.app-auth.outputs.token }}
      repo: gcp-domain-name
      commiter: "${{ steps.app-auth.outputs.credentials }}"

Im going to use this credentials as a commiter value for the gitops commits, while keeping the author as pull-request authors

What do you think of this idea? Are you open to this addition? if you are open to the idea and credentials is acceptable name, I will update docs and test to finalise the pull-request

@iamstarkov iamstarkov requested review from gr2m, parkerbxyz and a team as code owners May 30, 2024 20:31
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

I'd say that's outside of the scope of this action. We can add it as a usage exapmle to the readme though, to show how to create a committer string from the provided outputs.

@iamstarkov
Copy link
Author

shame really, I'm writing an gitops action for developers and it will be so much easier to use committer output field rather than asking them to construct it by themselves

@gr2m
Copy link
Contributor

gr2m commented Jun 7, 2024

I'm writing an gitops action for developers and it will be so much easier to use committer output field rather than asking them to construct it by themselves

you will have to document usage of your action anyway, which will include the use of this action. Adding another step to create a new output for the committer really doesn't add much, your users will end up copy-and-pasting your usage example anyway.

Here is an example

      - uses: actions/create-github-app-token@main
        id: app-auth
        with:
          app-id: ${{ vars.GR2M_GITHUB_APP_ID }}
          private-key: ${{ secrets.GR2M_GITHUB_APP_PRIVATE_KEY }}
      - id: committer
        run: echo "string=${{steps.app-auth.outputs.app-slug}}[bot] <${{ steps.app-auth.outputs.installation-id }}+${{ steps.app-auth.outputs.app-slug }}[bot]@users.noreply.github.com>"  >> "$GITHUB_OUTPUT"
      - run: echo "committer string is ${{steps.committer.outputs.string}}"

I'll add that to our README

@gr2m
Copy link
Contributor

gr2m commented Jun 7, 2024

there you go, let us know what you think: #142

@iamstarkov
Copy link
Author

@gr2m thank you, it looks good. I'll close this pr

@create-app-token-action-releaser

🎉 This issue has been resolved in version 1.10.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants