Skip to content

Commit

Permalink
Merge pull request #4 from rseng/add/gollum-event
Browse files Browse the repository at this point in the history
Add/gollum event
  • Loading branch information
vsoch authored Aug 20, 2020
2 parents eacc49d + e067081 commit 36ed4da
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ For help building your query, it's recommended to try your search in the
is not defined, the update will be skipped, and you will be required to already
have a users.txt file.

### `cleanup`

If defined as anything, clean up the previous collection folder before generating
new events. If not defined, skip cleanup entirely (old events will be preserved).

### `exclude_users_file`

**Optional** The path to the exclude-users.txt (or otherwise named) file that has
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
description: 'The relative path in the repository for the exclude-users.txt (or other named file) for users to not include if discovered programatically.'
required: true
default: 'exclude-users.txt'
cleanup:
description: 'If defined, clean up the previous folder (removing previous events) If not defined, skip cleanup.'
required: false
query:
description: 'A user query to run before updating the users_file. If left blank, will not be updated.'
required: false
Expand Down
6 changes: 4 additions & 2 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ if [ ! -d "/github/workspace/docs" ]; then
fi

# Cleanup old set of first issues
printf "Cleaning up previous events...\n"
rm -rf "/github/workspace/docs/${INPUT_COLLECTION}"
if [ ! -z "${INPUT_CLEANUP}" ]; then
printf "Cleaning up previous events...\n"
rm -rf "/github/workspace/docs/${INPUT_COLLECTION}"
fi
export INPUT_COLLECTION

# Generate Stanford Issues
Expand Down
2 changes: 2 additions & 0 deletions scripts/generate-events.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def generate_content(event, user, seen):
"<a href='https://github.com/%s' target='_blank'>%s</a> <a href='%s' target='_blank'>reviewed</a> a <a href='%s' target='_blank'>%s pull request</a>\n\n<small>%s</small>\n\n<a href='%s' target='_blank'>View Review</a>"
% (user, user, url, pull_request_url, repo_name, body, url)
)

else:
print(f"Event type {event_type} not supported!")
return None
Expand Down Expand Up @@ -268,6 +269,7 @@ def write_events(events, output_dir):
# We don't care about watching, forking, etc.
# https://docs.github.com/en/developers/webhooks-and-events/github-event-types
if event["type"] in [
"GollumEvent",
"WatchEvent",
"ForkEvent",
"MemberEvent",
Expand Down

0 comments on commit 36ed4da

Please sign in to comment.