Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update docs test empty html #5

Merged
merged 5 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ jobs:
script: |
const fs = require('fs');
const output = fs.readFileSync('diff_output.html', 'utf8');

const regex = /<pre class="ansi2html-content">\s*<\/pre>/;
if (regex.test(output)) {
console.log("Output within <pre> tag is empty or only contains whitespace. Skipping comment post.");
return;
}

const issue_number = context.issue.number;
github.rest.issues.createComment({
owner: context.repo.owner,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Usage
### Local Testing
1. Change or delete any json files located in /test_files
1. Change or delete any json files located in `/test_files`
2. `bash ./run.sh`

### CI Implementation
Copy the file `.github/workflows/main.yaml` along with its parent directories into the root folder of a custom app. Change the branch on lines 4 and 6 if applicable. Keep the `1` on line 23 to print table diffs or change it to `0` for trees.
Copy the file `.github/workflows/main.yaml` along with its parent directories into the root folder of a custom app. Change the branch on lines 4 and 6 if applicable. Keep the `1` on line 24 to print table diffs or change it to `0` for trees.

## Output
Runner terminals will show JSON file names and diff content for any modified files, and names of deleted files. If any schema changes (changed JSON) are present, the workflow will fail.
Expand Down