thehanimo / pr-title-checker

An action to automatically check if pull request titles conform to Contribution Guidelines
MIT License
109 stars 36 forks source link

Configuration file outside the repo #28

Closed dave-v closed 1 year ago

dave-v commented 2 years ago

We would like to use this action on many different repos with the same configuration, so it would be nice to define the configuration in a common location and reuse it.

An example is this action: https://github.com/release-drafter/release-drafter#configuration-options (look at the paragraph after the table of options that mentions Probot config). In that case, we are able to put configuration files in a separate repo, and each repo using the action can get its config from there.

Perhaps a simple way could be to allow the configuration_path to accept a URL returning the configuration, or for private repos, providing the repo and filepath in that repo, an appropriate access token, and using the GitHub API to extract file contents.

If you would accept a PR, I might have a go.

thehanimo commented 2 years ago

That definitely seems like a nice feature to have! I like the configuration_path-being-a-URL approach which will essentially be a public URL. About private repos, would a parameter like is_private or even better, a key along with the URL help?

So this way, there will be 3 types of paths to config files:

  1. Relative to current repo
  2. Absolute public URLs
  3. Absolute private URLs (with a flag/key)

Also, PRs are always welcome :)

dave-v commented 2 years ago

I will do some experimenting... but probably quite slowly 🙂.

rjulius23 commented 1 year ago

Isnt it an option to make the GITHUB_REPOSITORY an input variable ? That way you can specify your template repository where your workflow templates are.

Noamshmueli commented 1 year ago

+1

alexschwartz commented 1 year ago

+1

I am trying to use this action as an organization wide required action. And it always look for the config file in the wrong location

thehanimo commented 1 year ago

I'll treat this as high priority. PRs welcome :)

smzelek commented 1 year ago

@dave-v @thehanimo I unintentionally made a PR that partially addresses this issue: https://github.com/thehanimo/pr-title-checker/pull/36

in this PR you can provide a local filepath to your configuration. we needed shared configuration across all our repos, so we use this action with a prior step that downloads the configuration file.

thehanimo commented 1 year ago

@alexschwartz @dave-v @Noamshmueli @rjulius23 more ways to specify config file is now supported in v1.4.0