From 54e3f4bbcdcc09b81bc891471f6d5c61ed109574 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 01:52:53 +0000 Subject: [PATCH 1/5] Initial plan From cc04268d55968ebb4105381b7e1624b8703be8a2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 01:54:42 +0000 Subject: [PATCH 2/5] Add auto-push workflow for WacWac project Co-authored-by: Salt05 <174848190+Salt05@users.noreply.github.com> --- .github/workflows/README.md | 67 +++++++++++++++++++++++++++++++++ .github/workflows/auto-push.yml | 49 ++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 .github/workflows/README.md create mode 100644 .github/workflows/auto-push.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000..d97606c --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,67 @@ +# Auto Push Workflow - Hướng dẫn sử dụng + +## Mô tả +Workflow này cho phép bạn tự động commit và push các thay đổi trong dự án WacWac chỉ bằng một cú nhấp chuột. + +## Cách sử dụng + +### 1. Kích hoạt workflow thủ công +1. Vào trang repository GitHub của bạn: https://github.com/Salt05/WacWac +2. Click vào tab **Actions** +3. Chọn workflow **Auto Push Data** từ danh sách bên trái +4. Click nút **Run workflow** (màu xanh) +5. (Tùy chọn) Nhập commit message tùy chỉnh hoặc để mặc định +6. Click **Run workflow** để bắt đầu + +### 2. Workflow sẽ tự động: +- Kiểm tra các thay đổi trong repository +- Commit tất cả các thay đổi với message bạn đã nhập +- Push code lên GitHub +- Thông báo nếu không có thay đổi nào + +## Tính năng +- ✅ Kích hoạt thủ công khi cần +- ✅ Tùy chỉnh commit message +- ✅ Tự động phát hiện thay đổi +- ✅ Push an toàn lên GitHub +- ✅ Thông báo rõ ràng về trạng thái + +## Lưu ý +- Workflow này sẽ commit **tất cả** các thay đổi trong repository +- Đảm bảo bạn có quyền push vào branch hiện tại +- Workflow chỉ chạy khi bạn kích hoạt thủ công + +--- + +# Auto Push Workflow - Usage Guide + +## Description +This workflow allows you to automatically commit and push changes in the WacWac project with just one click. + +## How to Use + +### 1. Manually trigger the workflow +1. Go to your GitHub repository page: https://github.com/Salt05/WacWac +2. Click on the **Actions** tab +3. Select the **Auto Push Data** workflow from the left sidebar +4. Click the **Run workflow** button (green) +5. (Optional) Enter a custom commit message or leave the default +6. Click **Run workflow** to start + +### 2. The workflow will automatically: +- Check for changes in the repository +- Commit all changes with your specified message +- Push the code to GitHub +- Notify if there are no changes + +## Features +- ✅ Manual trigger when needed +- ✅ Customizable commit message +- ✅ Automatic change detection +- ✅ Safe push to GitHub +- ✅ Clear status notifications + +## Notes +- This workflow will commit **all** changes in the repository +- Make sure you have push permissions to the current branch +- The workflow only runs when you manually trigger it diff --git a/.github/workflows/auto-push.yml b/.github/workflows/auto-push.yml new file mode 100644 index 0000000..ab816c9 --- /dev/null +++ b/.github/workflows/auto-push.yml @@ -0,0 +1,49 @@ +name: Auto Push Data + +# This workflow can be manually triggered to commit and push any changes +on: + workflow_dispatch: + inputs: + commit_message: + description: 'Commit message for the changes' + required: false + default: 'Auto-update data' + +jobs: + auto-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Check for changes + id: check_changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "changes=true" >> $GITHUB_OUTPUT + echo "Found changes to commit" + else + echo "changes=false" >> $GITHUB_OUTPUT + echo "No changes to commit" + fi + + - name: Commit and push changes + if: steps.check_changes.outputs.changes == 'true' + run: | + git add . + git commit -m "${{ github.event.inputs.commit_message }}" + git push + + - name: No changes message + if: steps.check_changes.outputs.changes == 'false' + run: | + echo "✓ No changes detected. Repository is up to date." From 8471b37278e5d83e6b418928839fba7a6667a11c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 01:55:17 +0000 Subject: [PATCH 3/5] Clean up workflow formatting and fix trailing spaces Co-authored-by: Salt05 <174848190+Salt05@users.noreply.github.com> --- .github/workflows/auto-push.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-push.yml b/.github/workflows/auto-push.yml index ab816c9..2602cf6 100644 --- a/.github/workflows/auto-push.yml +++ b/.github/workflows/auto-push.yml @@ -12,19 +12,19 @@ on: jobs: auto-push: runs-on: ubuntu-latest - + steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - + - name: Configure Git run: | git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Check for changes id: check_changes run: | @@ -35,14 +35,14 @@ jobs: echo "changes=false" >> $GITHUB_OUTPUT echo "No changes to commit" fi - + - name: Commit and push changes if: steps.check_changes.outputs.changes == 'true' run: | git add . git commit -m "${{ github.event.inputs.commit_message }}" git push - + - name: No changes message if: steps.check_changes.outputs.changes == 'false' run: | From 4d371468c7abb81d04d6172ce95780ce5f7c8386 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 01:56:08 +0000 Subject: [PATCH 4/5] Fix security: sanitize commit message and specify push branch Co-authored-by: Salt05 <174848190+Salt05@users.noreply.github.com> --- .github/workflows/auto-push.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-push.yml b/.github/workflows/auto-push.yml index 2602cf6..ac68a35 100644 --- a/.github/workflows/auto-push.yml +++ b/.github/workflows/auto-push.yml @@ -38,10 +38,12 @@ jobs: - name: Commit and push changes if: steps.check_changes.outputs.changes == 'true' + env: + COMMIT_MESSAGE: ${{ github.event.inputs.commit_message }} run: | git add . - git commit -m "${{ github.event.inputs.commit_message }}" - git push + git commit -m "$COMMIT_MESSAGE" + git push origin ${{ github.ref }} - name: No changes message if: steps.check_changes.outputs.changes == 'false' From 16d36b0dc20a6f342c406932e48a04824d991165 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 01:56:53 +0000 Subject: [PATCH 5/5] Add explicit permissions to workflow for security Co-authored-by: Salt05 <174848190+Salt05@users.noreply.github.com> --- .github/workflows/auto-push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/auto-push.yml b/.github/workflows/auto-push.yml index ac68a35..4988b9c 100644 --- a/.github/workflows/auto-push.yml +++ b/.github/workflows/auto-push.yml @@ -12,6 +12,8 @@ on: jobs: auto-push: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout repository