Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iloveitaly/github-actions-metadata-sync
Github Action to sync repo metadata from code to repo
https://github.com/iloveitaly/github-actions-metadata-sync
description homepage keywords metadata npm nuget repo sync topics website
Last synced: 8 days ago
JSON representation
Github Action to sync repo metadata from code to repo
- Host: GitHub
- URL: https://github.com/iloveitaly/github-actions-metadata-sync
- Owner: iloveitaly
- License: mit
- Created: 2024-03-19T19:30:26.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-30T14:00:18.000Z (2 months ago)
- Last Synced: 2024-09-20T06:02:11.094Z (13 days ago)
- Topics: description, homepage, keywords, metadata, npm, nuget, repo, sync, topics, website
- Language: Shell
- Homepage: https://github.com/kbrashears5/github-action-repo-sync
- Size: 93.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Metadata Sync [![version](https://img.shields.io/github/v/release/iloveitaly/github-actions-metadata-sync)](https://img.shields.io/github/v/release/iloveitaly/github-actions-metadata-sync)
Github Action to sync repo metadata (description, homepage, topics) from code to repo.
## Use Cases
Keep the GitHub repo metadata (description, tags) in sync with your code! Metadata is now configuration as code, and can be validated with a Pull Request.
This is nearly identical to [github-actions-repo-sync](https://github.com/kbrashears5/github-action-repo-sync) with the primary differences being:
* Docker container is pulled and not built dynamically (less runtime)
* The file name and type are inferred from the repo, so there's less configuration## Setup
Create a new file called `.github/workflows/repo-sync.yml` that looks like so:
```yaml
name: Repository Metadata Syncon:
push:
branches: [main, master]jobs:
repo_sync:
runs-on: ubuntu-latest
steps:
- name: Fetching Local Repository
uses: actions/checkout@v4
- name: Repository Metadata Sync
uses: iloveitaly/github-actions-metadata-sync@v1
with:
TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
```Note that the built in `secrets.github_token` does not have the necessary permissions to update the repo description. You must use a personal access token instead:
```shell
gh secret set GH_PERSONAL_TOKEN --app actions --body ghp_the_key
```Alternatively, you can manually specify the type and path (these are inferred from the repo type by default):
```yaml
name: Repository Metadata Syncon:
push:
branches: [main]jobs:
repo_sync:
runs-on: ubuntu-latest
steps:
- name: Fetching Local Repository
uses: actions/checkout@v4
- name: Repository Metadata Sync
uses: iloveitaly/github-actions-metadata-sync@v1
with:
TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
# optional params, these are inferred from the repo type!
TYPE: npm
PATH: package.json
```## Parameters
| Parameter | Required | Description |
| --- | --- | --- |
| TYPE | true | Type of repo. See below for supported repo types |
| PATH | true | Path to the repo type's metadata file |
| TOKEN | true | Personal Access Token with Repo scope |## Supported Repo Types
| Repo Type | File | Description |
| --- | --- | --- |
| npm | package.json | package.json for repo |
| nuget | ProjectName.csproj | csproj file for project |
| python | ProjectName.toml | toml file for project |Note if using standard `PATH` inputs the `TYPE` input is not required.
## Metadata without a package manager
For repo types that aren't listed above (like this one), you can still use this action, just have to get creative.
For example (and I would recommend), you can create a file called `metadata.json`, choose the npm type, and make the file look like so:
```json
{
"description": "Repo description",
"homepage": "https://github.com/kbrashears5/github-action-repo-sync",
"keywords": [
"sync",
"repo",
"metadata"
]
}
```For example, see [.github/workflows/repo-sync.yml](.github/workflows/repo-metadata-sync.yml) and `metadata.json` in this repo