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

Release v.0.1.1 #4

Merged
merged 7 commits into from
Sep 23, 2020
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Calculates traffic and clones and stores in CSV file
- name: Repository Traffic
id: traffic
uses: ./
uses: sangonzal/[email protected]
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ COPY Pipfile.lock /
RUN pip install 'pipenv==2018.11.26'
RUN pipenv install --deploy --ignore-pipfile

ENTRYPOINT ["pipenv", "run", "python", "./main.py"]
ENTRYPOINT ["pipenv", "run", "python", "/main.py"]
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Repository Traffic GitHub Action

Github action that can be used to store repository traffic and clones past the default 2 week period. It pulls traffic and clones data from the GitHub API and stores it into a csv file, which can be commited to your repository or uploaded to storage elsewhere.
Github action that can be used to store repository traffic and clones past the default 2 week period. It pulls traffic and clones data from the GitHub API v3 and stores it into a csv file, which can be commited to your repository or uploaded elsewhere.

# Usage

Expand All @@ -23,7 +23,7 @@ Create a `workflow.yml` file and place in your `.github/workflows` folder. You c
# Calculates traffic and clones and stores in CSV file
- name: Repository Traffic
id: traffic
uses: ./
uses: sangonzal/[email protected]
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
```
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
# Calculates traffic and clones and stores in CSV file
- name: GitHub traffic
id: traffic
uses: ./
uses: sangonzal/[email protected]
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}

Expand All @@ -63,8 +63,9 @@ jobs:
author_name: Santiago Gonzalez
message: "GitHub traffic"
add: "./traffic/*"
ref: "traffic" # commits to branch "traffic"
```
### Sample workflow that runs weekly and commits files to repository.
### Sample workflow that runs weekly and uploads files to S3.

If you'd like to avoid commiting the data to the repository, you can use another action to upload elsewhere. For example, you could upload to S3 using the [S3 Sync action](https://github.com/marketplace/actions/s3-sync) .

Expand All @@ -88,7 +89,7 @@ jobs:
# Calculates traffic and clones and stores in CSV file
- name: Repository Traffic
id: traffic
uses: ./
uses: sangonzal/[email protected]
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}

Expand Down
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ def main():
# Consider letting users configure plots
# traffic_weekly = traffic_frame.resample("W", label="left").sum().tail(12)
# clones_weekly = clones_frame.resample("W", label="left").sum().tail(12)
traffic_frame.tail(30).plot(ax=axes[0])
clones_frame.tail(30).plot(ax=axes[1])
if not traffic_frame.empty:
traffic_frame.tail(30).plot(ax=axes[0])
if not clones_frame.empty:
clones_frame.tail(30).plot(ax=axes[1])
plt.savefig(plots_path)


Expand Down