0

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 main page)
meta_data:
description: JDK main-line development
website: https://openjdk.org/projects/jdk
topics: [ java, jvm, openjdk ]
enter image description here

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

uvsmtid
  • 4,187
  • 4
  • 38
  • 64

1 Answers1

1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    That will do. I just thought they have a standard basic functions covered. For example, like pypi.org which takes metadata of projects from setup.py file. But this answer opens eyes on other possibilities. Thanks, @VonC! – uvsmtid Dec 28 '22 at 16:35