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

Service user for GitHub #186

Closed
myhau opened this issue Dec 14, 2022 · 4 comments
Closed

Service user for GitHub #186

myhau opened this issue Dec 14, 2022 · 4 comments

Comments

@myhau
Copy link
Member

myhau commented Dec 14, 2022

We can't use the default github-actions user, because its commits do not trigger CI (see example PR here: #183).

Issue on GitHub: peter-evans/create-pull-request#48

Do

  • create user with name similar to pulumi-kotlin-bot
  • add to virtuslabrnd organization by raising a support ticket
  • add to jvm-lab team (anyone from @VirtuslabRnD/jvm-lab team should be able to do it, or @myhau )
  • securely share random password with team members or store somewhere
  • create a personal access token for this user
  • modify the cleanup step in prepare_release.yml so that automatic pull requests will now be opened by the service user (this can probably be done by configuring the author and/or committer properties in https://github.com/peter-evans/create-pull-request)

Future stuff

With a service user like this, we could automate the releases of new schemas. We would just need to run ./gradlew prepareReleaseOfUpdatedSchemas on some cron schedule and create a PR if any changes are made (similarly as in the cleanup step in prepare_release.yml)

@jplewa
Copy link
Member

jplewa commented Dec 14, 2022

@jplewa
Copy link
Member

jplewa commented Feb 10, 2023

We now have the email address [email protected], so a service user could be registered using this address

@myhau
Copy link
Member Author

myhau commented Jul 11, 2023

It's done, but we want to address one more thing before closing this issue:

In a separate task we will transfer (or create a new one) GitHub App to VirtuslabRnD organization (#238).

@jplewa
Copy link
Member

jplewa commented Jul 12, 2023

Instead of a service user, we created a GitHub app: https://github.com/apps/pulumi-kotlin

jplewa added a commit that referenced this issue Jul 13, 2023
## Task

Resolves: #194 #186

## Description

I added the action defined in `update_schemas.yml` which will
periodically check if new versions of any of the schemas are available.
It will then open a pull request. Two additional changes were made:
- Both this action as well as the cleanup step in `prepare_release.yml`
(which also opens a PR) will now rely on GitHub application tokens. I
followed [this
tutorial](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens)
to create this application and I'm waiting for the VirtuslabRnD admins
to approve it to be added to this repository. Pull requests created by
an app should trigger CI builds.
- ~~I added an extra action defined in
`publish_to_maven_local_before_release.yml`. It's a duplicate of
`publish_to_maven_local.yml` but with a different condition (it will be
triggered by a pull request when its source branch matches the regex
`prepare-release-.*`).~~ EDIT: I changed this. The action defined in
`publish_to_maven_local.yml` should now get triggered on push to main,
on workflow dispatch, and on pull request **if the source branch has the
appropriate name**.
@jplewa jplewa closed this as completed Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants