@@ -32,19 +32,26 @@ jobs:
3232
3333 - name : Get changed files
3434 id : changed_files
35+ uses : tj-actions/changed-files@v45
36+
37+ # run: |
38+ # # 通过 GitHub API 获取 PR 的变更文件列表
39+ # changed_files=$(curl -s \
40+ # -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
41+ # "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
42+ # jq -r '.[].filename') # 使用 jq 提取文件名
43+ # curl -s \
44+ # -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
45+ # "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
46+ # echo "$changed_files" | grep -v '^MAINTAINERS$' > changed_files.txt
47+ - name : List all changed files
3548 env :
36- SUPER_SECRET : ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}
49+ ALL_CHANGED_FILES : ${{ steps.changed-files.outputs.all_changed_files }}
3750 run : |
38- # 通过 GitHub API 获取 PR 的变更文件列表
39- changed_files=$(curl -s \
40- -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
41- "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
42- jq -r '.[].filename') # 使用 jq 提取文件名
43- curl -s \
44- -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN_AUTO_REVIEW }}" \
45- "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
46- echo "$changed_files" | grep -v '^MAINTAINERS$' > changed_files.txt
47-
51+ for file in ${ALL_CHANGED_FILES}; do
52+ echo "$file was changed"
53+ done
54+ echo "${ALL_CHANGED_FILES}" | grep -v '^MAINTAINERS$' > changed_files.txt
4855 - name : Parse MAINTAINERS file
4956 id : parse_maintainer
5057 run : |
0 commit comments