Home > Software engineering >  Make GitHub extract repo settings from a file
Make GitHub extract repo settings from a file

Time:12-29

Is there a way to set repo settings inside a file so that GitHub displays them on the main page?

Input (e.g. .github.yaml in main branch) Output (repo enter image description here

I'm looking for an answer without calling GitHub APIs.

CodePudding user response:

I'm looking for an answer without calling GitHub APIs.

And yet, a call to updating a repository API would certainly be involved, through a GitHub Action.

You can setup such an action triggered only by your file, in the main branch:

on:
  push:
    branches: ['main']
    paths: ['.github.yaml']

And use directly a gh repo edit -d '...' call, since the GitHub CLI I is preinstalled on all GitHub-hosted runners.

That way, each time you modify the .github.yaml file, you can regenerate the About message on your repository.

  • Related