Conversation
- 將 CI 中的 git-auto-commit-action 替換為 create-pull-request, 避免直接推送至 main 分支,改以 PR 方式提交搜尋索引更新 - 更新全站 22 個 HTML 頁面的版權年份從 2025 至 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the CI workflow strategy and refreshes copyright information across the website for the new year 2026.
Changes:
- Modified CI workflow to use pull request-based updates instead of direct commits to main branch for search index changes
- Updated copyright year from 2025 to 2026 across all 22 HTML pages site-wide
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/link-checker.yml | Replaced git-auto-commit-action with create-pull-request action to submit search index updates via PR instead of direct push |
| sitemap.html | Updated footer copyright year to 2026 |
| about.html | Updated footer copyright year to 2026 |
| index.html | Updated footer copyright year to 2026 |
| advanced-resources/competitions.html | Updated footer copyright year to 2026 |
| advanced-resources/index.html | Updated footer copyright year to 2026 |
| advanced-resources/online-courses.html | Updated footer copyright year to 2026 |
| advanced-resources/reading-list.html | Updated footer copyright year to 2026 |
| autonomous-learning/index.html | Updated footer copyright year to 2026 |
| autonomous-learning/methodology.html | Updated footer copyright year to 2026 |
| autonomous-learning/plan-templates.html | Updated footer copyright year to 2026 |
| autonomous-learning/resource-map.html | Updated footer copyright year to 2026 |
| autonomous-learning/topic-ideas.html | Updated footer copyright year to 2026 |
| career-exploration/competency-map.html | Updated footer copyright year to 2026 |
| career-exploration/index.html | Updated footer copyright year to 2026 |
| career-exploration/major-explorer.html | Updated footer copyright year to 2026 |
| career-exploration/senior-interviews.html | Updated footer copyright year to 2026 |
| civic-tech-map/index.html | Updated footer copyright year to 2026 |
| learning-portfolio/activity-database.html | Updated footer copyright year to 2026 |
| learning-portfolio/index.html | Updated footer copyright year to 2026 |
| learning-portfolio/portfolio-gallery.html | Updated footer copyright year to 2026 |
| learning-portfolio/reflection-guide.html | Updated footer copyright year to 2026 |
| learning-portfolio/tools.html | Updated footer copyright year to 2026 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Create Pull Request for search index | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| commit_message: "chore(bot): ✨ 自動更新搜尋索引" | ||
| file_pattern: 'search-index.json' | ||
| commit-message: "chore(bot): 自動更新搜尋索引" | ||
| title: "chore(bot): 自動更新搜尋索引" | ||
| body: "由 CI 自動產生:搜尋索引檔案已更新。" | ||
| branch: chore/update-search-index |
There was a problem hiding this comment.
The workflow will create a pull request every time the search index changes on the main branch. However, there's a potential issue: if the same branch name 'chore/update-search-index' already exists with an open PR, this could fail or cause conflicts. Consider adding the 'delete-branch' parameter set to true to clean up merged branches, or use a unique branch name with a timestamp or commit SHA.
| - name: Create Pull Request for search index | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| commit_message: "chore(bot): ✨ 自動更新搜尋索引" | ||
| file_pattern: 'search-index.json' | ||
| commit-message: "chore(bot): 自動更新搜尋索引" | ||
| title: "chore(bot): 自動更新搜尋索引" | ||
| body: "由 CI 自動產生:搜尋索引檔案已更新。" | ||
| branch: chore/update-search-index | ||
| add-paths: search-index.json |
There was a problem hiding this comment.
The create-pull-request action requires appropriate permissions to create pull requests. Without an explicit token parameter, it will use the default GITHUB_TOKEN, which should work for most cases. However, be aware that PRs created with GITHUB_TOKEN won't trigger other workflow runs (like CI checks on the PR itself). If you need the PR to trigger workflows, consider using a Personal Access Token (PAT) or GitHub App token with the 'token' parameter.
| - name: Create Pull Request for search index | ||
| if: github.ref == 'refs/heads/main' | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| commit_message: "chore(bot): ✨ 自動更新搜尋索引" | ||
| file_pattern: 'search-index.json' | ||
| commit-message: "chore(bot): 自動更新搜尋索引" | ||
| title: "chore(bot): 自動更新搜尋索引" | ||
| body: "由 CI 自動產生:搜尋索引檔案已更新。" | ||
| branch: chore/update-search-index | ||
| add-paths: search-index.json |
There was a problem hiding this comment.
The workflow will only create a pull request if there are actual changes to search-index.json. However, if no changes are detected, the action will still succeed but not create a PR. Consider checking the action output and potentially adding a condition or notification to track when updates are skipped due to no changes.
- 移除上一次 PowerShell 寫入時意外加入的 UTF-8 BOM (0xEF 0xBB 0xBF) - workflow 加入 delete-branch: true,確保合併後自動清理分支
Summary
stefanzweifel/git-auto-commit-action@v5替換為peter-evans/create-pull-request@v7,搜尋索引更新改以 PR 方式提交,避免直接推送至 main 分支Test plan