Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/albertsmit/sitecite

Check if your cited sources are still up! 🚀
https://github.com/albertsmit/sitecite

Last synced: about 1 month ago
JSON representation

Check if your cited sources are still up! 🚀

Awesome Lists containing this project

README

        



Logo
sitecite
Logo


Check if your cited sources are still up. :rocket:

## Usage

You can now consume the action by referencing the v1 branch

```yaml
uses: albertsmit/sitecite@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
urlfield: "link"
textfield: "quote"
path: "./data/quotes.json"
failOnNotFound: true
```

## Inputs

| Input | Type | Required | Default |
| ---------------- | ------- | -------- | ----------------- |
| `token` | string | `true` | `null` |
| `urlfield` | string | `true` | `link` |
| `textfield` | string | `true` | `quote` |
| `path` | string | `true` | `./sitecite.json` |
| `failOnNotFound` | boolean | `false` | `false` |

## Outputs

| Output | Type | Description |
| ---------- | ------- | --------------------------------------------- |
| `failures` | boolean | Wether any quote has been failed to be found |
| `results` | array | The actual results as found in the PR comment |

## Expected JSON format

The expected JSON format is as follows.\
**Sitecite** looks for a `quotes` key in the root of the provided JSON.\
Then, from that **array**, it takes the data from these keys:

- **URL** key from your `urlfield` input/key.
- **Quote** key from your `textfield` input/key.

### Example:

```json
{
"quotes": [
{
"link": "https://policies.google.com/terms?hl=en",
"quote": "respect the rights of others"
},
{
"link": "https://www.apple.com/legal/internet-services/itunes/us/terms.html",
"quote": "Please carefully read the information presented"
}
]
}
```

This means that if, for instance, your:

- `urlfield` is `tomato`, and
- your `textfield` is `textgoeshere`

**sitecite** will look for this:

```json
"quotes": [
{
"tomato": "https://www.url-goes-here.io",
"textgoeshere": "Guess what goes here! Woohoo!"
}
]
```

## Special thanks

Credit where credit is due!
Thanks for some functions :heart:

- [Firebase Deploy Action](https://github.com/FirebaseExtended/action-hosting-deploy)
- [JS Action Template](https://github.com/actions/javascript-action)