From 205d1d1769ee23b1c40fbe4ad6ca461fb903e35c Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:28:13 -0600 Subject: [PATCH 01/12] adjust badge and counter + pipelines --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cf0c57..2461caa 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,9 @@ Last updated: 2025-05-13 +
-

Total Visitors

- Visitor Count + Total views +

Refresh Date: 2025-07-16

+ From a652783d03ee1af2acf80a2935c8ffa1e8d5a8bc Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:28:44 -0600 Subject: [PATCH 02/12] changing abadge --- autoscaleMultiple-IOPS/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autoscaleMultiple-IOPS/README.md b/autoscaleMultiple-IOPS/README.md index 0baf402..ac3905b 100644 --- a/autoscaleMultiple-IOPS/README.md +++ b/autoscaleMultiple-IOPS/README.md @@ -74,7 +74,9 @@ Review [the script](./scripts/enable_autoscale_iops_across_subscription.py), and 2. Make sure you're logged in: `az login` 4. Run the script: `python {script-name}.py` +
-

Total Visitors

- Visitor Count + Total views +

Refresh Date: 2025-07-16

+ From 8ae55f5672402f9f5fc88fd4e01460cfe8ad0030 Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:30:03 -0600 Subject: [PATCH 03/12] adjusting pipeline so not conflict --- .github/workflows/update-md-date.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-md-date.yml b/.github/workflows/update-md-date.yml index 96dc9d7..3792859 100644 --- a/.github/workflows/update-md-date.yml +++ b/.github/workflows/update-md-date.yml @@ -7,7 +7,8 @@ on: permissions: contents: write - + pull-requests: write + jobs: update-date: runs-on: ubuntu-latest @@ -30,12 +31,17 @@ jobs: run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - + - name: Update last modified date in Markdown files run: python .github/workflows/update_date.py - name: Commit changes + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git fetch origin + git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" git add -A git commit -m "Update last modified date in Markdown files" || echo "No changes to commit" + git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }} git push origin HEAD:${{ github.event.pull_request.head.ref }} From 4aabd6a81a37dfa42b9191854e5fd292bac52857 Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:31:27 -0600 Subject: [PATCH 04/12] cleaning pipeline --- .github/workflows/validate_and_fix_markdown.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate_and_fix_markdown.yml b/.github/workflows/validate_and_fix_markdown.yml index cd98f3c..75060b9 100644 --- a/.github/workflows/validate_and_fix_markdown.yml +++ b/.github/workflows/validate_and_fix_markdown.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + pull-requests: write jobs: validate-and-fix-markdown: @@ -27,7 +28,7 @@ jobs: run: npm install -g markdownlint-cli - name: Lint and Fix Markdown files - run: markdownlint '**/*.md' --fix --config .github/.markdownlint.json --ignore GPT-RAG_SolutionAccelerator/ + run: markdownlint '**/*.md' --fix --config .github/.markdownlint.json - name: Configure Git run: | From ffe32af04a98cad480c420485e59538afbae0420 Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:35:24 -0600 Subject: [PATCH 05/12] + counter pipeline --- .github/workflows/use-visitor-counter.yml | 94 +++++++++++++++++++++++ 1 file changed, 94 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..4aa2c96 --- /dev/null +++ b/.github/workflows/use-visitor-counter.yml @@ -0,0 +1,94 @@ +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" + + - name: Commit and push changes (PR) + if: github.event_name == 'pull_request' + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git fetch origin + git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }} + git add "*.md" metrics.json + 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 pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" + git push origin HEAD:${{ github.event.pull_request.head.ref }} + + - 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.event.pull_request.head.ref }} || git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }} + git add "*.md" metrics.json + 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 pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" + git push origin HEAD:${{ github.event.pull_request.head.ref }} + + - name: Create Pull Request (non-PR) + if: github.event_name != 'pull_request' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: update-visitor-count + title: "Update visitor count" + body: "Automated update of visitor count" + base: main From 3f0ab90eb2ba054c6f8057d9689b1ef1f86f05a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jul 2025 15:35:43 +0000 Subject: [PATCH 06/12] Update visitor count --- README.md | 2 +- autoscaleMultiple-IOPS/README.md | 2 +- metrics.json | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 metrics.json diff --git a/README.md b/README.md index 2461caa..56636b8 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Last updated: 2025-05-13
- Total views + Total views

Refresh Date: 2025-07-16

diff --git a/autoscaleMultiple-IOPS/README.md b/autoscaleMultiple-IOPS/README.md index ac3905b..1caeaef 100644 --- a/autoscaleMultiple-IOPS/README.md +++ b/autoscaleMultiple-IOPS/README.md @@ -76,7 +76,7 @@ Review [the script](./scripts/enable_autoscale_iops_across_subscription.py), and
- Total views + Total views

Refresh Date: 2025-07-16

diff --git a/metrics.json b/metrics.json new file mode 100644 index 0000000..c9fdd61 --- /dev/null +++ b/metrics.json @@ -0,0 +1,32 @@ +[ + { + "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": 4, + "uniques": 1 + } +] \ No newline at end of file From f2e3950ed6d28f1509a3f66c5a159d491f741a46 Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:40:42 -0600 Subject: [PATCH 07/12] testing pull -> push --- .github/workflows/validate_and_fix_markdown.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate_and_fix_markdown.yml b/.github/workflows/validate_and_fix_markdown.yml index 75060b9..208609d 100644 --- a/.github/workflows/validate_and_fix_markdown.yml +++ b/.github/workflows/validate_and_fix_markdown.yml @@ -35,10 +35,10 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - - name: Commit changes + - name: Commit and rebase changes run: | - git fetch origin - git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }} + git fetch origin ${{ github.event.pull_request.head.ref }} + git checkout ${{ github.event.pull_request.head.ref }} git add -A git commit -m "Fix Markdown syntax issues" || echo "No changes to commit" git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" From 400ea1a0ba6755a4a9848ab8e2248a43447ae30c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jul 2025 15:40:54 +0000 Subject: [PATCH 08/12] Update visitor count --- README.md | 2 +- autoscaleMultiple-IOPS/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 56636b8..5fea93d 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Last updated: 2025-05-13
- Total views + Total views

Refresh Date: 2025-07-16

diff --git a/autoscaleMultiple-IOPS/README.md b/autoscaleMultiple-IOPS/README.md index 1caeaef..04ee9f5 100644 --- a/autoscaleMultiple-IOPS/README.md +++ b/autoscaleMultiple-IOPS/README.md @@ -76,7 +76,7 @@ Review [the script](./scripts/enable_autoscale_iops_across_subscription.py), and
- Total views + Total views

Refresh Date: 2025-07-16

From fadec72d6ce366054da2c313eb6cee793a8b8e2b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jul 2025 15:41:03 +0000 Subject: [PATCH 09/12] Update last modified date in Markdown files --- README.md | 2 +- autoscaleMultiple-IOPS/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5fea93d..3ecbbd9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Costa Rica [![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/) [brown9804](https://github.com/brown9804) -Last updated: 2025-05-13 +Last updated: 2025-07-16 ---------- diff --git a/autoscaleMultiple-IOPS/README.md b/autoscaleMultiple-IOPS/README.md index 04ee9f5..5ee7d38 100644 --- a/autoscaleMultiple-IOPS/README.md +++ b/autoscaleMultiple-IOPS/README.md @@ -5,7 +5,7 @@ Costa Rica [![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/) [brown9804](https://github.com/brown9804) -Last updated: 2025-05-13 +Last updated: 2025-07-16 ---------- From 1eef65c760bf1a18ab05b922705a2415ccc9dcfc Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:42:41 -0600 Subject: [PATCH 10/12] testing target --- .github/workflows/validate_and_fix_markdown.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_and_fix_markdown.yml b/.github/workflows/validate_and_fix_markdown.yml index 208609d..4cef7ef 100644 --- a/.github/workflows/validate_and_fix_markdown.yml +++ b/.github/workflows/validate_and_fix_markdown.yml @@ -36,10 +36,10 @@ jobs: git config --global user.name "github-actions[bot]" - name: Commit and rebase changes + env: + PR_BRANCH: ${{ github.head_ref || github.ref_name }} run: | - git fetch origin ${{ github.event.pull_request.head.ref }} - git checkout ${{ github.event.pull_request.head.ref }} git add -A git commit -m "Fix Markdown syntax issues" || echo "No changes to commit" - git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" - git push origin HEAD:${{ github.event.pull_request.head.ref }} + git pull --rebase origin "$PR_BRANCH" || echo "No rebase needed" + git push origin HEAD:"$PR_BRANCH" From 56e0ba17bb86523141f5fec527d72f31f8afad88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jul 2025 15:42:59 +0000 Subject: [PATCH 11/12] Fix Markdown syntax issues --- autoscaleMultiple-IOPS/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/autoscaleMultiple-IOPS/README.md b/autoscaleMultiple-IOPS/README.md index 5ee7d38..06b86d6 100644 --- a/autoscaleMultiple-IOPS/README.md +++ b/autoscaleMultiple-IOPS/README.md @@ -21,7 +21,6 @@ Last updated: 2025-07-16 - > [!NOTE] > Enable Autoscale IOPS via REST API, as now this is the only way to automate enabling Autoscale IOPS since, Azure CLI and PowerShell do not support this setting yet. From e4df86c50038e24db4f6b74e48f5b406d5ecdc4f Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:43:32 -0600 Subject: [PATCH 12/12] teting counter logic