Skip to content

Commit fd9678b

Browse files
committed
2 parents cc5ae81 + 73110d8 commit fd9678b

5 files changed

Lines changed: 47 additions & 48 deletions

File tree

.github/workflows/use-visitor-counter.yml

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,55 @@ name: Use Visitor Counter Logic
22

33
on:
44
pull_request:
5-
branches:
6-
- main
7-
workflow_dispatch: # Allows manual triggering
5+
branches: [main]
6+
workflow_dispatch:
87
# schedule:
98
# - cron: '0 0 * * *' # Runs daily at midnight
10-
9+
1110
permissions:
1211
contents: write
1312
pull-requests: write
1413

14+
# Prevent parallel runs from racing on the same branch
15+
concurrency:
16+
group: visitor-counter-${{ github.repository }}-${{ github.event.pull_request.head.ref || github.ref_name }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
update-visitor-count:
1721
runs-on: ubuntu-latest
1822

1923
steps:
20-
- name: Checkout current repository
24+
# Checkout the *actual branch* we intend to push to
25+
# (avoids being on refs/pull/<id>/merge and needing a later checkout)
26+
- name: Checkout target branch
2127
uses: actions/checkout@v4
2228
with:
2329
fetch-depth: 0
30+
clean: true
31+
persist-credentials: false
32+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
33+
34+
- name: Configure Git author
35+
run: |
36+
git config user.name "github-actions[bot]"
37+
git config user.email "github-actions[bot]@users.noreply.github.com"
38+
39+
# Optional but recommended: sync before generating changes (no checkout later)
40+
- name: Sync branch with origin
41+
env:
42+
TARGET_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
43+
run: |
44+
git fetch origin "$TARGET_REF"
45+
git pull --no-rebase --no-edit origin "$TARGET_REF" || true
2446
2547
- name: Shallow clone visitor counter logic
2648
run: git clone --depth=1 https://github.com/brown9804/github-visitor-counter.git
2749

2850
- name: Set up Node.js
2951
uses: actions/setup-node@v4
3052
with:
31-
node-version: '20'
53+
node-version: "20"
3254

3355
- name: Install dependencies for github-visitor-counter
3456
run: |
@@ -44,43 +66,20 @@ jobs:
4466
- name: Move generated metrics.json to root
4567
run: mv github-visitor-counter/metrics.json .
4668

47-
- name: List files for debugging
48-
run: |
49-
ls -l
50-
ls -l github-visitor-counter
51-
5269
- name: Clean up visitor counter logic
5370
run: rm -rf github-visitor-counter
5471

55-
- name: Configure Git author
56-
run: |
57-
git config --global user.name "github-actions[bot]"
58-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
59-
60-
# Commit and push logic for PR events (merge, not rebase)
61-
- name: Commit and push changes (PR)
62-
if: github.event_name == 'pull_request'
72+
- name: Commit and push (only if changed)
6373
env:
6474
TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
TARGET_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
6576
run: |
66-
git fetch origin
67-
git checkout ${{ github.head_ref }}
68-
git pull origin ${{ github.head_ref }} || echo "No merge needed"
69-
git add -A
70-
git commit -m "Update visitor count" || echo "No changes to commit"
71-
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
72-
git push origin HEAD:${{ github.head_ref }}
77+
if [ -z "$(git status --porcelain)" ]; then
78+
echo "No changes to commit"
79+
exit 0
80+
fi
7381
74-
# Commit and push logic for non-PR events (merge, not rebase)
75-
- name: Commit and push changes (non-PR)
76-
if: github.event_name != 'pull_request'
77-
env:
78-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
run: |
80-
git fetch origin
81-
git checkout ${{ github.ref_name }} || git checkout -b ${{ github.ref_name }} origin/${{ github.ref_name }}
82-
git pull origin ${{ github.ref_name }} || echo "No merge needed"
8382
git add -A
84-
git commit -m "Update visitor count" || echo "No changes to commit"
85-
git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
86-
git push origin HEAD:${{ github.ref_name }}
83+
git commit -m "Update visitor count"
84+
85+
git push "https://x-access-token:${TOKEN}@github.com/${{ github.repository }}" "HEAD:${TARGET_REF}"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Costa Rica
55
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
66
[brown9804](https://github.com/brown9804)
77

8-
Last updated: 2026-02-02
8+
Last updated: 2026-03-13
99

1010
----------
1111

1212
> [!IMPORTANT]
13-
> 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!
13+
> 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!
1414
1515
<details>
1616
<summary><b>List of References</b> (Click to expand)</summary>
@@ -292,7 +292,7 @@ graph TD
292292
293293
<!-- START BADGE -->
294294
<div align="center">
295-
<img src="https://img.shields.io/badge/Total%20views-1416-limegreen" alt="Total views">
296-
<p>Refresh Date: 2026-02-02</p>
295+
<img src="https://img.shields.io/badge/Total%20views-1314-limegreen" alt="Total views">
296+
<p>Refresh Date: 2026-03-13</p>
297297
</div>
298298
<!-- END BADGE -->

TROUBLESHOOTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ terraform apply
353353

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

src/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fastapi==0.115.0
1313
uvicorn[standard]==0.32.0
1414
websockets==13.1
1515
jinja2==3.1.6
16-
python-multipart==0.0.12
17-
orjson==3.10.7
16+
python-multipart==0.0.22
17+
orjson==3.11.6
1818
pydantic==2.9.2
1919
Pillow>=10.4.0

terraform-infrastructure/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ graph TD;
136136

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

0 commit comments

Comments
 (0)