Skip to content

Commit 123eb91

Browse files
authored
Update mypy_primer workflow (#17987)
Update the mypy_primer workflow to use actions/upload-artifact@v4. https://github.com/actions/upload-artifact/tree/v4
1 parent 539513a commit 123eb91

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

.github/workflows/mypy_primer.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,35 @@ jobs:
6969
--output concise \
7070
| tee diff_${{ matrix.shard-index }}.txt
7171
) || [ $? -eq 1 ]
72-
- name: Upload mypy_primer diff
73-
uses: actions/upload-artifact@v3
74-
with:
75-
name: mypy_primer_diffs
76-
path: diff_${{ matrix.shard-index }}.txt
77-
- if: ${{ matrix.shard-index }} == 0
72+
- if: ${{ matrix.shard-index == 0 }}
7873
name: Save PR number
7974
run: |
8075
echo ${{ github.event.pull_request.number }} | tee pr_number.txt
81-
- if: ${{ matrix.shard-index }} == 0
82-
name: Upload PR number
83-
uses: actions/upload-artifact@v3
76+
- if: ${{ matrix.shard-index == 0 }}
77+
name: Upload mypy_primer diff + PR number
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: mypy_primer_diffs-${{ matrix.shard-index }}
81+
path: |
82+
diff_${{ matrix.shard-index }}.txt
83+
pr_number.txt
84+
- name: Upload mypy_primer diff
85+
uses: actions/upload-artifact@v4
86+
if: ${{ matrix.shard-index != 0 }}
87+
with:
88+
name: mypy_primer_diffs-${{ matrix.shard-index }}
89+
path: diff_${{ matrix.shard-index }}.txt
90+
91+
join_artifacts:
92+
name: Join artifacts
93+
runs-on: ubuntu-latest
94+
needs: [mypy_primer]
95+
permissions:
96+
contents: read
97+
steps:
98+
- name: Merge artifacts
99+
uses: actions/upload-artifact/merge@v4
84100
with:
85101
name: mypy_primer_diffs
86-
path: pr_number.txt
102+
pattern: mypy_primer_diffs-*
103+
delete-merged: true

.github/workflows/mypy_primer_comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1919
steps:
2020
- name: Download diffs
21-
uses: actions/github-script@v6
21+
uses: actions/github-script@v7
2222
with:
2323
script: |
2424
const fs = require('fs');

0 commit comments

Comments
 (0)