From 772f00e0304296c36a4834f7c19898245ed7924e Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 20 Aug 2025 10:45:00 -0600 Subject: [PATCH 1/2] counter pipeline - testing --- .github/workflows/use-visitor-counter.yml | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/use-visitor-counter.yml diff --git a/.github/workflows/use-visitor-counter.yml b/.github/workflows/use-visitor-counter.yml new file mode 100644 index 0000000..b865948 --- /dev/null +++ b/.github/workflows/use-visitor-counter.yml @@ -0,0 +1,86 @@ +name: Use Visitor Counter Logic + +on: + pull_request: + branches: + - main + schedule: + - cron: '0 0 * * *' # Runs daily at midnight + workflow_dispatch: # Allows manual triggering + +permissions: + contents: write + pull-requests: write + +jobs: + update-visitor-count: + runs-on: ubuntu-latest + + steps: + - name: Checkout current repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Shallow clone visitor counter logic + run: git clone --depth=1 https://github.com/brown9804/github-visitor-counter.git + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies for github-visitor-counter + run: | + cd github-visitor-counter + npm ci + + - name: Run visitor counter logic (updates markdown badges and metrics.json) + run: node github-visitor-counter/update_repo_views_counter.js + env: + TRAFFIC_TOKEN: ${{ secrets.TRAFFIC_TOKEN }} + REPO: ${{ github.repository }} + + - name: Move generated metrics.json to root + run: mv github-visitor-counter/metrics.json . + + - name: List files for debugging + run: | + ls -l + ls -l github-visitor-counter + + - name: Clean up visitor counter logic + run: rm -rf github-visitor-counter + + - name: Configure Git author + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + # Commit and push logic for PR events (merge, not rebase) + - name: Commit and push changes (PR) + if: github.event_name == 'pull_request' + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git fetch origin + git checkout ${{ github.head_ref }} + git pull origin ${{ github.head_ref }} || echo "No merge needed" + git add -A + git commit -m "Update visitor count" || echo "No changes to commit" + git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }} + git push origin HEAD:${{ github.head_ref }} + + # Commit and push logic for non-PR events (merge, not rebase) + - name: Commit and push changes (non-PR) + if: github.event_name != 'pull_request' + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git fetch origin + git checkout ${{ github.ref_name }} || git checkout -b ${{ github.ref_name }} origin/${{ github.ref_name }} + git pull origin ${{ github.ref_name }} || echo "No merge needed" + git add -A + git commit -m "Update visitor count" || echo "No changes to commit" + git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }} + git push origin HEAD:${{ github.ref_name }} From eb0abcee7fc042751f0b3f4a59bda1684b8dec38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Aug 2025 16:45:28 +0000 Subject: [PATCH 2/2] Update visitor count --- 0-Energy_Hardware_Optimization.md | 4 ++-- 1-Cloud_k8s_Scaling.md | 2 +- 2-Azure_Stack_Architecture.md | 2 +- README.md | 4 ++-- metrics.json | 37 +++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 metrics.json diff --git a/0-Energy_Hardware_Optimization.md b/0-Energy_Hardware_Optimization.md index e6d9b95..70a490a 100644 --- a/0-Energy_Hardware_Optimization.md +++ b/0-Energy_Hardware_Optimization.md @@ -270,7 +270,7 @@ az aks update -g ResourceGroup -n EfficientAKS --enable-cluster-autoscaler --min
- Total views -

Refresh Date: 2025-08-18

+ Total views +

Refresh Date: 2025-08-20

diff --git a/1-Cloud_k8s_Scaling.md b/1-Cloud_k8s_Scaling.md index 1f5a5c7..846721e 100644 --- a/1-Cloud_k8s_Scaling.md +++ b/1-Cloud_k8s_Scaling.md @@ -1285,7 +1285,7 @@ foreach ($vm in $vmList) {
- Total views + Total views

Refresh Date: 2025-08-20

diff --git a/2-Azure_Stack_Architecture.md b/2-Azure_Stack_Architecture.md index 857cd98..89a12ac 100644 --- a/2-Azure_Stack_Architecture.md +++ b/2-Azure_Stack_Architecture.md @@ -1065,7 +1065,7 @@ Layer Interactions:
- Total views + Total views

Refresh Date: 2025-08-20

diff --git a/README.md b/README.md index b777dc9..8563d65 100644 --- a/README.md +++ b/README.md @@ -1280,7 +1280,7 @@ From [K8s cluster components](https://kubernetes.io/docs/concepts/architecture/)
- Total views -

Refresh Date: 2025-08-18

+ Total views +

Refresh Date: 2025-08-20

diff --git a/metrics.json b/metrics.json new file mode 100644 index 0000000..8665541 --- /dev/null +++ b/metrics.json @@ -0,0 +1,37 @@ +[ + { + "date": "2025-07-07", + "count": 330, + "uniques": 20 + }, + { + "date": "2025-07-08", + "count": 159, + "uniques": 6 + }, + { + "date": "2025-07-10", + "count": 482, + "uniques": 1 + }, + { + "date": "2025-07-11", + "count": 170, + "uniques": 4 + }, + { + "date": "2025-07-12", + "count": 7, + "uniques": 1 + }, + { + "date": "2025-07-14", + "count": 130, + "uniques": 2 + }, + { + "date": "2025-07-15", + "count": 2, + "uniques": 1 + } +] \ No newline at end of file