77 - ' *no-ci*'
88 push :
99 branches :
10- - master
10+ - main
1111 workflow_dispatch :
1212 inputs :
1313 ansys_version :
@@ -120,7 +120,7 @@ jobs:
120120 wheelhouse : false
121121 standalone_suffix : ${{needs.pick_server_suffix.outputs.suffix}}
122122 test_any : ${{ matrix.test-any }}
123- DOCSTRING : ${{ ! matrix.test-any }}
123+ DOCSTRING : ${{ matrix.test-any == 'false' }}
124124 secrets : inherit
125125
126126 docker_tests :
@@ -148,7 +148,7 @@ jobs:
148148 if : |
149149 github.event.action != 'closed' &&
150150 (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
151- (startsWith(github.head_ref, 'master ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
151+ (startsWith(github.head_ref, 'main ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
152152 uses : ./.github/workflows/docs.yml
153153 needs : pick_server_suffix
154154 with :
@@ -183,7 +183,7 @@ jobs:
183183 if : |
184184 github.event.action != 'closed' &&
185185 (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
186- (github.ref == 'refs/heads/master ' && github.event_name == 'push')
186+ (github.ref == 'refs/heads/main ' && github.event_name == 'push')
187187 needs : [docs]
188188 steps :
189189 - name : " Upload development documentation"
@@ -200,7 +200,7 @@ jobs:
200200 if : |
201201 github.event.action != 'closed' &&
202202 (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
203- (startsWith(github.head_ref, 'master ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
203+ (startsWith(github.head_ref, 'main ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
204204 uses : ./.github/workflows/examples.yml
205205 needs : pick_server_suffix
206206 with :
@@ -214,12 +214,12 @@ jobs:
214214 if : |
215215 github.event.action != 'closed' &&
216216 (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
217- (startsWith(github.head_ref, 'master ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
217+ (startsWith(github.head_ref, 'main ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
218218 uses : ./.github/workflows/pydpf-post.yml
219219 needs : pick_server_suffix
220220 with :
221221 ANSYS_VERSION : ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
222- post_branch : " master "
222+ post_branch : " main "
223223 standalone_suffix : ${{needs.pick_server_suffix.outputs.suffix}}
224224 test_docstrings : " true"
225225 secrets : inherit
@@ -229,7 +229,7 @@ jobs:
229229 if : |
230230 github.event.action != 'closed' &&
231231 (github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
232- (startsWith(github.head_ref, 'master ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
232+ (startsWith(github.head_ref, 'main ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
233233 strategy :
234234 fail-fast : false
235235 matrix :
@@ -248,3 +248,39 @@ jobs:
248248 DOCSTRING : false
249249 standalone_suffix : ${{ matrix.dpf.standalone-suffix }}
250250 secrets : inherit
251+
252+ sync-main-with-master :
253+ name : " Sync main with master"
254+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
255+ runs-on : ubuntu-latest
256+ steps :
257+ - name : " Install Git and clone project"
258+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
259+ with :
260+ token : ${{ secrets.MIGRATION_PAT }}
261+ fetch-depth : 0
262+
263+ - name : " Verify that main is the default branch"
264+ shell : bash
265+ run : |
266+ head_branch=$(git remote show origin | grep "HEAD branch:")
267+ main_branch=${head_branch#*: }
268+
269+ if [[ $main_branch != "main" ]]; then
270+ echo "The default branch is not 'main'. It is set to '$main_branch'."
271+ echo "Please set 'main' as the default branch in the repository settings."
272+ exit 1
273+ fi
274+
275+ - name : " Configure git username and email"
276+ shell : bash
277+ run : |
278+ git config --global user.name "${{ secrets.PYANSYS_CI_BOT_USERNAME }}"
279+ git config --global user.email "${{ secrets.PYANSYS_CI_BOT_EMAIL }}"
280+
281+ - name : " Sync main to master"
282+ shell : bash
283+ run : |
284+ git checkout master
285+ git reset --hard main
286+ git push
0 commit comments