Skip to content
Merged
Show file tree
Hide file tree
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
75 changes: 37 additions & 38 deletions .github/workflows/use-visitor-counter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,55 @@ name: Use Visitor Counter Logic

on:
pull_request:
branches:
- main
workflow_dispatch: # Allows manual triggering
branches: [main]
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # Runs daily at midnight

permissions:
contents: write
pull-requests: write

# Prevent parallel runs from racing on the same branch
concurrency:
group: visitor-counter-${{ github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true

jobs:
update-visitor-count:
runs-on: ubuntu-latest

steps:
- name: Checkout current repository
# Checkout the *actual branch* we intend to push to
# (avoids being on refs/pull/<id>/merge and needing a later checkout)
- name: Checkout target branch
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: true
persist-credentials: false
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}

- name: Configure Git author
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Optional but recommended: sync before generating changes (no checkout later)
- name: Sync branch with origin
env:
TARGET_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
run: |
git fetch origin "$TARGET_REF"
git pull --no-rebase --no-edit origin "$TARGET_REF" || true

- 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'
node-version: "20"

- name: Install dependencies for github-visitor-counter
run: |
Expand All @@ -44,43 +66,20 @@ jobs:
- 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'
- name: Commit and push (only if changed)
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
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 }}
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
exit 0
fi

# 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 }}
git commit -m "Update visitor count"

git push "https://x-access-token:${TOKEN}@github.com/${{ github.repository }}" "HEAD:${TARGET_REF}"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Costa Rica
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
[brown9804](https://github.com/brown9804)

Last updated: 2026-02-02
Last updated: 2026-03-13

----------

> [!IMPORTANT]
> Disclaimer: This repository contains a demo of `Zava AI Shopping Assistant`, a multi-agent system implementing Agent-to-Agent (A2A) protocol for e-commerce. It features a fully automated `"Zero-Touch" deployment` pipeline orchestrated by Terraform, which `provisions infrastructure, ingests data, creates specialized AI agents with delegation patterns in MSFT Foundry, and deploys the complete A2A application stack.` Feel free to modify this as needed, it's just a reference. Please refer [TechWorkshop L300: AI Apps and Agents](https://microsoft.github.io/TechWorkshop-L300-AI-Apps-and-agents/), and if needed contact Microsoft directly: [Microsoft Sales and Support](https://support.microsoft.com/contactus?ContactUsExperienceEntryPointAssetId=S.HP.SMC-HOME) for more guidance. There are tons of free resources out there, all eager to support!
> Disclaimer: This repository contains a demo of `Zava AI Shopping Assistant`, a multi-agent system implementing Agent-to-Agent (A2A) protocol for e-commerce. It features a fully automated `"Zero-Touch" deployment` pipeline orchestrated by Terraform, which `provisions infrastructure, ingests data, creates specialized AI agents with delegation patterns in MSFT Foundry, and deploys the complete A2A application stack.` Feel free to modify this as needed, it's just a reference. Please refer [TechWorkshop L300: AI Apps and Agents](https://microsoft.github.io/TechWorkshop-L300-AI-Apps-and-agents/), and if needed contact Microsoft directly: [Microsoft Sales and Support](https://support.microsoft.com/contactus?ContactUsExperienceEntryPointAssetId=S.HP.SMC-HOME) for more guidance. There are tons of free resources out there, all eager to support!

<details>
<summary><b>List of References</b> (Click to expand)</summary>
Expand Down Expand Up @@ -229,7 +229,7 @@ graph TD

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1416-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-02</p>
<img src="https://img.shields.io/badge/Total%20views-1314-limegreen" alt="Total views">
<p>Refresh Date: 2026-03-13</p>
</div>
<!-- END BADGE -->
4 changes: 2 additions & 2 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ terraform apply

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1416-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-02</p>
<img src="https://img.shields.io/badge/Total%20views-1314-limegreen" alt="Total views">
<p>Refresh Date: 2026-03-13</p>
</div>
<!-- END BADGE -->
4 changes: 2 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fastapi==0.115.0
uvicorn[standard]==0.32.0
websockets==13.1
jinja2==3.1.6
python-multipart==0.0.12
orjson==3.10.7
python-multipart==0.0.22
orjson==3.11.6
pydantic==2.9.2
Pillow>=10.4.0
4 changes: 2 additions & 2 deletions terraform-infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ graph TD;

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-1416-limegreen" alt="Total views">
<p>Refresh Date: 2026-02-02</p>
<img src="https://img.shields.io/badge/Total%20views-1314-limegreen" alt="Total views">
<p>Refresh Date: 2026-03-13</p>
</div>
<!-- END BADGE -->