From 3851689dee10cd4bb94876cc4e3bdb83060a0fce Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez Date: Fri, 25 Sep 2020 11:20:09 -0700 Subject: [PATCH 1/3] Update README --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 82f2e5d..85b261a 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,8 @@ After you have generated the PAT, go to the "Settings" tab of the repository, cl Create a `workflow.yml` file and place in your `.github/workflows` folder. You can reference the action from this workflow. The only required parameter is setting the PAT that was generated when setting up the permissions. ```yaml steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - # Calculates traffic and clones and stores in CSV file - name: Repository Traffic - id: traffic uses: sangonzal/repository-traffic-action@v0.1.1 env: TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} @@ -48,10 +44,11 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + with: + ref: "traffic" # Calculates traffic and clones and stores in CSV file - name: GitHub traffic - id: traffic uses: sangonzal/repository-traffic-action@v0.1.1 env: TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} @@ -65,9 +62,12 @@ jobs: add: "./traffic/*" ref: "traffic" # commits to branch "traffic" ``` +- Notes: + - Ensure that the ref used in actions/checkoutv2 is the same in Endbug/add-and-commit@v4. + ### 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) . +If you'd like to avoid commiting the data to the repository, you can use another action to upload elsewhere. For example, you could download and upload files from S3 using other github actions. ```yaml on: @@ -85,10 +85,17 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + + # Download from S3 + - uses: prewk/s3-cp-action@master + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + SOURCE: 's3://some-bucket/something-remote' + DEST: 'traffic' # Calculates traffic and clones and stores in CSV file - name: Repository Traffic - id: traffic uses: sangonzal/repository-traffic-action@v0.1.1 env: TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} From f8bf2088dbb1c97d936afec96a19b32181d7cb89 Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez Date: Tue, 27 Oct 2020 18:17:25 -0700 Subject: [PATCH 2/3] Update base image to python 3.8 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 69f351e..9440867 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3 +FROM python:3.8 # Tells pipenv to create virtualenvs in /root rather than $HOME/.local/share. # We do this because GitHub modifies the HOME variable between `docker build` and From 67ac242038709921afaa2e8b374252ae6c9ed715 Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez <35743865+sangonzal@users.noreply.github.com> Date: Tue, 27 Oct 2020 18:33:08 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 85b261a..586f70d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Create a `workflow.yml` file and place in your `.github/workflows` folder. You c steps: # Calculates traffic and clones and stores in CSV file - name: Repository Traffic - uses: sangonzal/repository-traffic-action@v0.1.1 + uses: sangonzal/repository-traffic-action@v0.1.2 env: TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} ``` @@ -49,7 +49,7 @@ jobs: # Calculates traffic and clones and stores in CSV file - name: GitHub traffic - uses: sangonzal/repository-traffic-action@v0.1.1 + uses: sangonzal/repository-traffic-action@v0.1.2 env: TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} @@ -96,7 +96,7 @@ jobs: # Calculates traffic and clones and stores in CSV file - name: Repository Traffic - uses: sangonzal/repository-traffic-action@v0.1.1 + uses: sangonzal/repository-traffic-action@v0.1.2 env: TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} @@ -110,4 +110,4 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} SOURCE_DIR: 'traffic' -``` \ No newline at end of file +```