Commit 567ed0e 1 parent dcf674e commit 567ed0e Copy full SHA for 567ed0e
File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 12
12
os : [macos-latest, ubuntu-18.04, windows-latest]
13
13
14
14
steps :
15
+ - name : Cancel previous runs on the same branch
16
+
17
+ with :
18
+ access_token : ${{ github.token }}
19
+
15
20
- uses : actions/checkout@v1
16
21
with :
17
22
fetch-depth : 0
22
27
with :
23
28
python-version : ' 3.7'
24
29
30
+ - name : Test for secrets access
31
+ id : check_secrets
32
+ shell : bash
33
+ run : |
34
+ unset HAS_SECRET
35
+ if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
36
+ echo ::set-output name=HAS_SECRET::${HAS_SECRET}
37
+ env :
38
+ SECRET : " ${{ secrets.test_pypi_password }}"
39
+
25
40
- name : Install cibuildwheel
26
41
run : |
27
42
python -m pip install --upgrade pip
@@ -100,6 +115,7 @@ jobs:
100
115
run : pip install twine
101
116
102
117
- name : Publish distribution to Test PyPI
118
+ if : steps.check_secrets.outputs.HAS_SECRET
103
119
env :
104
120
TWINE_REPOSITORY_URL : https://test.pypi.org/legacy/
105
121
TWINE_USERNAME : __token__
@@ -108,7 +124,7 @@ jobs:
108
124
run : twine upload --non-interactive --skip-existing --verbose 'dist/*'
109
125
110
126
- name : Publish distribution to PyPI
111
- if : startsWith(github.event.ref, 'refs/tags')
127
+ if : startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
112
128
env :
113
129
TWINE_USERNAME : __token__
114
130
TWINE_NON_INTERACTIVE : 1
You can’t perform that action at this time.
0 commit comments