@@ -53,22 +53,35 @@ jobs:
53
53
54
54
steps :
55
55
- uses : actions/checkout@v3
56
+
56
57
- uses : actions/setup-python@v4
57
58
with :
58
59
python-version : ${{ matrix.python }}
60
+
59
61
- uses : actions/download-artifact@v3
60
62
with :
61
63
name : pre-list-${{ matrix.python }}
64
+
62
65
- name : walk modules
63
66
env :
64
67
LISTGEN_PYTHON_VERSION : ${{ matrix.python }}
68
+ LISTGEN_DRY_RUN : ${{ inputs.dry-run }}
65
69
run : |
66
- python -V
67
70
python ./support/walk-modules.py "${LISTGEN_PYTHON_VERSION}.txt" < pre-list.txt
68
71
rm pre-list.txt
69
- sort -o "${LISTGEN_PYTHON_VERSION}.txt" "${LISTGEN_PYTHON_VERSION}.txt"
70
- mv "${LISTGEN_PYTHON_VERSION}.txt" ./stdlib_list/lists/
72
+
73
+ sort -u -o ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
74
+ ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
75
+ "${LISTGEN_PYTHON_VERSION}.txt"
76
+
77
+ rm "${LISTGEN_PYTHON_VERSION}.txt"
78
+
79
+ if [[ "${LISTGEN_DRY_RUN}" == "true" ]]; then
80
+ git diff
81
+ fi
82
+
71
83
- name : create PR
84
+ if : ${{ !inputs.dry-run }}
72
85
uses : peter-evans/create-pull-request@v5
73
86
with :
74
87
commit-message : " [BOT] update list for ${{ matrix.python }}"
@@ -94,22 +107,26 @@ jobs:
94
107
95
108
steps :
96
109
- uses : actions/checkout@v3
110
+
97
111
- uses : actions/setup-python@v4
98
112
with :
99
113
python-version : ${{ matrix.python }}
114
+
100
115
- name : walk modules
101
116
env :
102
117
LISTGEN_PYTHON_VERSION : ${{ matrix.python }}
103
118
LISTGEN_DRY_RUN : ${{ inputs.dry-run }}
104
119
run : |
105
- python -V
106
120
python ./support/walk-modules.py "${LISTGEN_PYTHON_VERSION}.txt"
107
- sort -o "${LISTGEN_PYTHON_VERSION}.txt" "${LISTGEN_PYTHON_VERSION}.txt"
121
+
122
+ sort -u -o ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
123
+ ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" \
124
+ "${LISTGEN_PYTHON_VERSION}.txt"
125
+
126
+ rm "${LISTGEN_PYTHON_VERSION}.txt"
108
127
109
128
if [[ "${LISTGEN_DRY_RUN}" == "true" ]]; then
110
- diff ./stdlib_list/lists/"${LISTGEN_PYTHON_VERSION}.txt" "${LISTGEN_PYTHON_VERSION}.txt"
111
- else
112
- mv "${LISTGEN_PYTHON_VERSION}.txt" ./stdlib_list/lists/
129
+ git diff
113
130
fi
114
131
115
132
- name : create PR
0 commit comments