Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dxw/whippet-application-tagger

A scheduled action to add a topic to all Whippet applications in the dxw org
https://github.com/dxw/whippet-application-tagger

govpress platform-tools

Last synced: 10 days ago
JSON representation

A scheduled action to add a topic to all Whippet applications in the dxw org

Awesome Lists containing this project

README

        

# Whippet Application Tagger

This runs a GitHub action on a schedule (once an hour), that looks for all repos in the dxw organization that have a `whippet.lock` file in the root, and adds the "whippet-app" topic to them.

This is primarily because GitHub's code search API does not return consistent results, so we can't rely on it to correctly identify all Whippet repos every time. So instead, we run this task hourly (to ensure that any repos it misses get tagged in one of the next runs), and search by the "whippet-app" topic when we want to find all Whippet applications we're managing in GitHub.

The script uses GitHub CLI (authenticated as a service user account) to interact with the relevant repos. The token for authenticating with GitHub CLI is a secret stored as `GOVPRESS_TOOLS_TOKEN`.

## Testing locally

You can run the main script locally whilst logged into your own account with GitHub CLI:

```
gh auth login
...
bin/whippet-application-tagger.sh
```

Or you can run the action as a whole using (act)[https://github.com/nektos/act]:

* Install act: `brew install act`
* Run the action: `act -j whippet-application-tagger -s GOVPRESS_TOOLS_TOKEN=[a token that has repo and org access]`

Note: this will actually run the action against live data, so will add the topic to any relevant repos that don't already have it.