From 6291997576e6e1e6f659ab0206d003fb07d11676 Mon Sep 17 00:00:00 2001 From: brown9804 Date: Mon, 21 Jul 2025 08:28:16 -0600 Subject: [PATCH 1/5] Update validate_and_fix_markdown.yml workflow - improve branch handling and commit process --- .../workflows/validate_and_fix_markdown.yml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_and_fix_markdown.yml b/.github/workflows/validate_and_fix_markdown.yml index 4cef7ef..8bb9f1f 100644 --- a/.github/workflows/validate_and_fix_markdown.yml +++ b/.github/workflows/validate_and_fix_markdown.yml @@ -18,6 +18,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.head_ref || github.ref_name }} - name: Set up Node.js uses: actions/setup-node@v3 @@ -35,11 +36,23 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - - name: Commit and rebase changes + - name: Commit and merge changes env: PR_BRANCH: ${{ github.head_ref || github.ref_name }} + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com run: | + # Ensure we're on the correct branch + git switch -c "$PR_BRANCH" || git switch "$PR_BRANCH" + + # Stage and commit changes if any git add -A - git commit -m "Fix Markdown syntax issues" || echo "No changes to commit" - git pull --rebase origin "$PR_BRANCH" || echo "No rebase needed" - git push origin HEAD:"$PR_BRANCH" + git diff --staged --quiet || git commit -m "Fix Markdown syntax issues" + + # Pull and merge existing changes + git pull origin "$PR_BRANCH" --no-rebase + + # Push all changes + git push origin "$PR_BRANCH" From 596c7f9095cafd16a0c461fa1f696d9ef421d19f Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Mon, 21 Jul 2025 08:32:53 -0600 Subject: [PATCH 2/5] testingE2e FLOW From 9c914238d33e3e03bbddd89def32ee041e4ff5a8 Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Mon, 21 Jul 2025 08:36:40 -0600 Subject: [PATCH 3/5] fixing conflict - Conflict Prevention: The pull before push ensures no conflicts - Safer Commits: Only commits when there are actual changes - Better Branch Management: Ensures operations happen on the correct branch - Consistent with Other Workflows: Matches the pattern from your markdown validation workflow --- .github/workflows/update-md-date.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-md-date.yml b/.github/workflows/update-md-date.yml index ac7a96d..ffc678c 100644 --- a/.github/workflows/update-md-date.yml +++ b/.github/workflows/update-md-date.yml @@ -18,6 +18,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.head_ref || github.ref_name }} - name: Set up Python uses: actions/setup-python@v4 @@ -35,13 +36,23 @@ jobs: - name: Update last modified date in Markdown files run: python .github/workflows/update_date.py - - name: Commit changes + - name: Commit and merge changes env: - TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_BRANCH: ${{ github.head_ref || github.ref_name }} + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com run: | - git fetch origin ${{ github.event.pull_request.head.ref }} - git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed" + # Ensure we're on the correct branch + git switch -c "$PR_BRANCH" || git switch "$PR_BRANCH" + + # Stage and commit changes if any 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 }} + git diff --staged --quiet || git commit -m "Update last modified date in Markdown files" + + # Pull and merge existing changes + git pull origin "$PR_BRANCH" --no-rebase + + # Push all changes + git push origin "$PR_BRANCH" From 5de109e1471fc434fe2843e8cf28570a51276e4f Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Mon, 21 Jul 2025 08:40:22 -0600 Subject: [PATCH 4/5] simplifying logic --- .github/workflows/use-visitor-counter.yml | 52 +++++++++-------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/.github/workflows/use-visitor-counter.yml b/.github/workflows/use-visitor-counter.yml index 4aa2c96..973fb24 100644 --- a/.github/workflows/use-visitor-counter.yml +++ b/.github/workflows/use-visitor-counter.yml @@ -21,6 +21,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.head_ref || github.ref_name }} - name: Shallow clone visitor counter logic run: git clone --depth=1 https://github.com/brown9804/github-visitor-counter.git @@ -57,38 +58,23 @@ jobs: 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' + - name: Commit and merge changes env: - TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_BRANCH: ${{ github.head_ref || github.ref_name }} + GIT_AUTHOR_NAME: github-actions[bot] + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com 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 + # Ensure we're on the correct branch + git switch -c "$PR_BRANCH" || git switch "$PR_BRANCH" + + # Stage and commit changes if any + git add -A + git diff --staged --quiet || git commit -m "Update visitor count" + + # Pull and merge existing changes + git pull origin "$PR_BRANCH" --no-rebase + + # Push all changes + git push origin "$PR_BRANCH" From 95546213f49605346a5f50c3f0c19e904723ab08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 21 Jul 2025 14:40:45 +0000 Subject: [PATCH 5/5] Update visitor count --- README.md | 4 ++-- metrics.json | 7 ++++++- terraform-infrastructure/README.md | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0ee3517..5bccfbe 100644 --- a/README.md +++ b/README.md @@ -440,7 +440,7 @@ Last updated: 2025-06-06
- Total views -

Refresh Date: 2025-07-16

+ Total views +

Refresh Date: 2025-07-21

diff --git a/metrics.json b/metrics.json index c9fdd61..8665541 100644 --- a/metrics.json +++ b/metrics.json @@ -26,7 +26,12 @@ }, { "date": "2025-07-14", - "count": 4, + "count": 130, + "uniques": 2 + }, + { + "date": "2025-07-15", + "count": 2, "uniques": 1 } ] \ No newline at end of file diff --git a/terraform-infrastructure/README.md b/terraform-infrastructure/README.md index 1d04c31..9ab5930 100644 --- a/terraform-infrastructure/README.md +++ b/terraform-infrastructure/README.md @@ -109,7 +109,7 @@ graph TD;
- Total views -

Refresh Date: 2025-07-16

+ Total views +

Refresh Date: 2025-07-21