Skip to content

Commit

Permalink
docs(github-actions-usage): Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
akash1810 committed Feb 22, 2024
1 parent e4337c6 commit cabbe16
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/github-actions-usage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# GitHub Actions Usage

This app, deployed as an AWS Lambda, tracks which GitHub Actions are in use across all repositories in the organisation.

## How it works
1. Get all records from the `github_workflows` table
2. For each record returned, parse the `contents` field
1. If the field is empty, log a message
2. Use [Ajv](https://ajv.js.org/) to validate the `contents` field against a [schema](https://json.schemastore.org/github-workflow.json) published by https://www.schemastore.org/json/ [^1]
3. If validation fails, log a message
3. Extract the `uses` string from the `contents`
4. Save results to database

## Updating the schema
The [schema](./src/schema/github-workflow.json) might need updating from time to time.

To do this, run the following, and commit the resulting file:

```bash
npm -w github-actions-usage run download-github-workflow-schema
```

0 comments on commit cabbe16

Please sign in to comment.