1313 BASE_API_OUTPUT : ci_outputs/base_branch_api
1414 DIFF_REPORT_OUTPUT : ci_outputs/diff_report
1515
16+ permissions :
17+ contents : read
18+ pull-requests : write
19+
1620jobs :
1721 diff_report :
1822 runs-on : macos-latest
23+ permissions :
24+ contents : read
25+ pull-requests : write
1926 env :
2027 FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT : 1
2128
@@ -24,14 +31,15 @@ jobs:
2431 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2532 with :
2633 fetch-depth : 2
34+ persist-credentials : false
2735
2836 - name : Copy diff report tools
2937 run : cp -a scripts/api_diff_report/. ~/api_diff_report
3038
3139 - id : get_changed_files
3240 name : Get changed file list
3341 run : |
34- echo "file_list=$(git diff --name-only -r HEAD^1 HEAD | tr '\n' ' ')" >> $GITHUB_OUTPUT
42+ echo "file_list=$(git diff --name-only -r HEAD^1 HEAD | tr '\n' ' ')" >> " $GITHUB_OUTPUT"
3543
3644 - name : Setup python
3745 uses : actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -42,27 +50,36 @@ jobs:
4250 run : ~/api_diff_report/prerequisite.sh
4351
4452 - name : Clean Diff Report Comment in PR
53+ env :
54+ STAGE : ${{ env.STAGE_PROGRESS }}
55+ TOKEN : ${{github.token}}
56+ PR_NUMBER : ${{github.event.pull_request.number}}
57+ RUN_ID : ${{github.run_id}}
4558 run : |
4659 python ~/api_diff_report/pr_commenter.py \
47- --stage ${{ env.STAGE_PROGRESS }} \
48- --token ${{github.token}} \
49- --pr_number ${{github.event.pull_request.number}} \
50- --commit $GITHUB_SHA \
51- --run_id ${{github.run_id}}
60+ --stage "$STAGE" \
61+ --token "$TOKEN" \
62+ --pr_number "$PR_NUMBER" \
63+ --commit " $GITHUB_SHA" \
64+ --run_id "$RUN_ID"
5265
5366 - name : Generate API files for PR branch
67+ env :
68+ FILE_LIST : ${{ steps.get_changed_files.outputs.file_list }}
5469 run : |
5570 python ~/api_diff_report/api_info.py \
56- --file_list ${{ steps.get_changed_files.outputs.file_list }} \
71+ --file_list "$FILE_LIST" \
5772 --output_dir ${{ env.PR_API_OUTPUT }}
5873
5974 - name : Checkout Base branch
6075 run : git checkout HEAD^
6176
6277 - name : Generate API files for Base branch
78+ env :
79+ FILE_LIST : ${{ steps.get_changed_files.outputs.file_list }}
6380 run : |
6481 python ~/api_diff_report/api_info.py \
65- --file_list ${{ steps.get_changed_files.outputs.file_list }} \
82+ --file_list "$FILE_LIST" \
6683 --output_dir ${{ env.BASE_API_OUTPUT }}
6784
6885 - name : Generate API Diff Report
@@ -73,14 +90,20 @@ jobs:
7390 --output_dir ${{ env.DIFF_REPORT_OUTPUT }}
7491
7592 - name : Update Diff Report Comment in PR
93+ env :
94+ STAGE : ${{ env.STAGE_END }}
95+ REPORT : ${{ env.DIFF_REPORT_OUTPUT }}
96+ TOKEN : ${{github.token}}
97+ PR_NUMBER : ${{github.event.pull_request.number}}
98+ RUN_ID : ${{github.run_id}}
7699 run : |
77100 python ~/api_diff_report/pr_commenter.py \
78- --stage ${{ env.STAGE_END }} \
79- --report ${{ env.DIFF_REPORT_OUTPUT }} \
80- --token ${{github.token}} \
81- --pr_number ${{github.event.pull_request.number}} \
82- --commit $GITHUB_SHA \
83- --run_id ${{github.run_id}}
101+ --stage "$STAGE" \
102+ --report "$REPORT" \
103+ --token "$TOKEN" \
104+ --pr_number "$PR_NUMBER" \
105+ --commit " $GITHUB_SHA" \
106+ --run_id "$RUN_ID"
84107
85108 - uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
86109 if : ${{ !cancelled() }}
0 commit comments