From e2e6d252d5de2e7ba65e6f753d430470707c6784 Mon Sep 17 00:00:00 2001 From: Alex Nolan Date: Fri, 21 Nov 2025 03:34:03 +0300 Subject: [PATCH] Update aztec-starter-traffic.yml --- .github/workflows/aztec-starter-traffic.yml | 62 ++++++++++++--------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/aztec-starter-traffic.yml b/.github/workflows/aztec-starter-traffic.yml index bbeefd1f..c59cda0b 100644 --- a/.github/workflows/aztec-starter-traffic.yml +++ b/.github/workflows/aztec-starter-traffic.yml @@ -1,37 +1,45 @@ name: Log aztec-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" aztec-starter-traffic: - # The type of runner that the job will run on runs-on: ubuntu-latest + + # 🛡️ PERMISSION: Grant explicit write permission for the job. + # This is a best practice, even when an external token is used. + 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). + # Uses the default GITHUB_TOKEN for cloning (read access). + - uses: actions/checkout@v4 + with: + token: ${{ secrets.TRAFFIC_ACTION_TOKEN }} - - # 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: "AztecProtocol/aztec-starter" - - # Commits files to repository - - name: Commit changes - uses: EndBug/add-and-commit@v4 - with: - author_name: Josh Crites - message: "aztec-starter GitHub traffic" - add: "./traffic/*" - ref: "traffic-aztec-starter" + # Calculates traffic and clones and stores in CSV file + - name: GitHub traffic + uses: sangonzal/repository-traffic-action@v.0.1.6 + env: + # Custom token used here for API call access (requires 'repo' scope). + TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }} + REPOSITORY_NAME: "AztecProtocol/aztec-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: github-actions[41898282+github-actions[bot]@users.noreply.github.com] + message: "docs(traffic): update aztec-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 (using the same branch checked out). + ref: "traffic-aztec-starter" # Keep the original dedicated branch intent