pr-title-checker icon indicating copy to clipboard operation
pr-title-checker copied to clipboard

Configuration file outside the repo

Open dave-v opened this issue 3 years ago • 2 comments
trafficstars

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.

dave-v avatar Jul 29 '22 08:07 dave-v

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 :)

thehanimo avatar Jul 29 '22 12:07 thehanimo

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

dave-v avatar Jul 29 '22 15:07 dave-v

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.

rjulius23 avatar Feb 06 '23 14:02 rjulius23

+1

Noamshmueli avatar Mar 23 '23 11:03 Noamshmueli

+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

alexschwartz avatar Apr 28 '23 12:04 alexschwartz

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

thehanimo avatar Apr 29 '23 05:04 thehanimo

@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.

smzelek avatar May 05 '23 20:05 smzelek

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

thehanimo avatar Jun 02 '23 07:06 thehanimo