Skip to content
Open
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
61 changes: 35 additions & 26 deletions .github/workflows/noir-starter-traffic.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
name: Log noir-starter traffic

on:
schedule:
# runs once a week on sunday
- cron: "55 23 * * 0"
schedule:
# ⏱️ CLEANUP: Runs once a week on Sunday, precisely at 00:00 UTC.
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
# This workflow contains a single job called "traffic"
noir-starter-traffic:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# 🛡️ PERMISSION: Grant explicit write permission for the commit step.
permissions:
contents: write

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
token: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
# 🚀 UPGRADE: Use the latest stable checkout version (@v4).
# The custom token is used here mainly for checking out (in case of private repo)
# and will be reused by the commit action for pushing.
- uses: actions/checkout@v4
with:
token: ${{ secrets.TRAFFIC_ACTION_TOKEN }}

# Calculates traffic and stores it in CSV file
- name: GitHub traffic
uses: sangonzal/repository-traffic-action@v.0.1.6
env:
# Custom token used here for reading the traffic API (requires 'repo' scope).
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
REPOSITORY_NAME: "noir-lang/noir-starter"

# Calculates traffic and clones and stores in CSV file
- name: GitHub traffic
uses: sangonzal/repository-traffic-action@v.0.1.6
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
REPOSITORY_NAME: "noir-lang/noir-starter"

# Commits files to repository
- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
author_name: Josh Crites
message: "noir-starter GitHub traffic"
add: "./traffic/*"
ref: "traffic-noir-starter"
# Commits files to repository
- name: Commit changes
uses: EndBug/add-and-commit@v9 # Use the latest stable version
with:
# 🤖 CONSISTENCY: Use the official GitHub Actions Bot identity.
author_name: github-actions[bot]
author_email: 41898282+github-actions[bot]@users.noreply.github.com
message: "docs(traffic): update noir-starter GitHub traffic data"
add: "./traffic/*"
# 🔑 SECURITY: Pass the custom token explicitly for push access.
token: ${{ secrets.TRAFFIC_ACTION_TOKEN }}
# The branch to commit to.
ref: "traffic-noir-starter"