Skip to content

Commit

Permalink
Create processed_files if not exist and print the complete error in t…
Browse files Browse the repository at this point in the history
…he github comment
  • Loading branch information
arash77 committed May 14, 2024
1 parent 4be5edc commit 6338190
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ jobs:
files: posts/**
json: "true"

- name: Create processed_files if not exist
if: steps.get_changed_files.outputs.any_changed == 'true'
run: |
if ! git show-ref --verify --quiet refs/heads/processed_files; then
git checkout --orphan processed_files
echo "" > processed_files.json
git add processed_files.json
git commit -m "Create processed_files"
git push origin processed_files
fi
- name: get published files cache
if: steps.get_changed_files.outputs.any_changed == 'true'
run: |
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/publish_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ jobs:
with:
files: posts/**
json: "true"

- name: Create processed_files if not exist
if: steps.get_changed_files.outputs.any_changed == 'true'
run: |
if ! git show-ref --verify --quiet refs/heads/processed_files; then
git checkout --orphan processed_files
echo "" > processed_files.json
git add processed_files.json
git commit -m "Create processed_files"
git push origin processed_files
fi
- name: get published files cache
if: steps.get_changed_files.outputs.any_changed == 'true'
Expand Down
6 changes: 4 additions & 2 deletions github_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import fnmatch
import os
import sys
import traceback

import requests

Expand Down Expand Up @@ -92,6 +93,7 @@ def get_files(self):
gs = galaxy_social(args.preview, args.json_out)
try:
message = gs.process_files(files_to_process)
github.comment(message)
except Exception as e:
message = e
github.comment(message)
github.comment(traceback.format_exc())
raise e

0 comments on commit 6338190

Please sign in to comment.