Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Use deploy key in actions that create PRs #477

Closed
wants to merge 2 commits into from

Conversation

faisal-memon
Copy link
Contributor

@faisal-memon faisal-memon commented Sep 6, 2023

Following steps in this medium article to hopefully fix issue where tests don't run for auto created PRs. Alternative approach is to create a bot account and use a PAT from that.

fixes #334 (hopefully)

Copy link
Contributor

@kfox1111 kfox1111 left a comment

Choose a reason for hiding this comment

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

I think this might work. Won't know for sure until we merge I think.

@faisal-memon faisal-memon marked this pull request as ready for review September 6, 2023 17:33
@marcofranssen
Copy link
Contributor

Why are we doing this? This is an anti pattern as it circumvents the permissions system in GH workflows.

Normally you just need to do following:

permissions:
  contents: write

This will allow the workflow to make a commit so we don't have to manage our own keys.

@kfox1111
Copy link
Contributor

kfox1111 commented Sep 7, 2023

Why are we doing this? This is an anti pattern as it circumvents the permissions system in GH workflows.

Normally you just need to do following:

permissions:
  contents: write

This will allow the workflow to make a commit so we don't have to manage our own keys.

Because the github workflows are broken with regard to submitting pr's that actually have their tests run automatically. :/

@marcofranssen
Copy link
Contributor

marcofranssen commented Sep 8, 2023

Did some additional research.

https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

  1. Seems if we want to do with deploy keys all workflows need to have the push event added as well in this PR. That also means it is a different workflow run and therefore also a different mandatory check, which complicates what we are doing.

  2. Another good option to me is the GitHub app option which also works on the pull_request event, so we don't have to change the workflow triggers and the mandotory checks in branch protection.

  3. As a workaround to trigger the workflow they also suggest to close and reopen the PR which also triggers the workflows, which is 2 manual clicks on these PRs. This would also allow us to stick with current merge checks as we don't have to change workflow triggers and such.

Signed-off-by: Faisal Memon <fymemon@yahoo.com>
Signed-off-by: Faisal Memon <fymemon@yahoo.com>
@faisal-memon
Copy link
Contributor Author

Thanks @marcofranssen for doing the research. Seems like this option won't work. Will look into the github app option.

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

Successfully merging this pull request may close these issues.

Test not running for automated PRs
3 participants