From 561bd664fc8d35a9a815df150b3d88426b685808 Mon Sep 17 00:00:00 2001 From: Guide Date: Fri, 21 Nov 2025 03:36:15 +0300 Subject: [PATCH] Update noir-starter-traffic.yml --- .github/workflows/noir-starter-traffic.yml | 61 +++++++++++++--------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/.github/workflows/noir-starter-traffic.yml b/.github/workflows/noir-starter-traffic.yml index bfdb069c..db1ad848 100644 --- a/.github/workflows/noir-starter-traffic.yml +++ b/.github/workflows/noir-starter-traffic.yml @@ -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"