File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 description : ' Repository to checkout'
1515 required : true
1616 default : ' python/cpython'
17+ publish :
18+ description : ' Publish to GitHub Pages'
19+ required : true
20+ default : false
1721permissions :
1822 contents : write
1923jobs :
@@ -103,11 +107,13 @@ jobs:
103107 path : ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs.epub
104108 if-no-files-found : ignore
105109 - name : Checkout gh-pages branch
110+ if : ${{ github.event.inputs.publish }}
106111 uses : actions/checkout@v4
107112 with :
108113 ref : gh-pages
109114 path : gh-pages
110115 - name : Copy generated archives to gh-pages
116+ if : ${{ github.event.inputs.publish }}
111117 run : |
112118 mkdir -p gh-pages/3
113119 # PDF
@@ -125,6 +131,7 @@ jobs:
125131 # EPUB
126132 cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs.epub gh-pages/3/python-${{ github.event.inputs.dist_version }}-docs.epub 2>/dev/null || true
127133 - name : Commit generated archives
134+ if : ${{ github.event.inputs.publish }}
128135 id : commit
129136 run : |
130137 cd gh-pages
@@ -139,7 +146,7 @@ jobs:
139146 echo "has_changes=true" >> $GITHUB_OUTPUT
140147 fi
141148 - name : Push commit
142- if : steps.commit.outputs.has_changes == 'true'
149+ if : ${{ github.event.inputs.publish && steps.commit.outputs.has_changes == 'true' }}
143150 uses : ad-m/github-push-action@master
144151 with :
145152 branch : gh-pages
You can’t perform that action at this time.
0 commit comments