77 - ' *no-ci*'
88 push :
99 branches :
10- - master
10+ - main
1111 workflow_dispatch :
1212 inputs :
1313 ansys_version :
@@ -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,6 @@ 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)
204203 uses : ./.github/workflows/examples.yml
205204 needs : pick_server_suffix
206205 with :
@@ -214,12 +213,12 @@ jobs:
214213 if : |
215214 github.event.action != 'closed' &&
216215 (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)
216+ (startsWith(github.head_ref, 'main ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
218217 uses : ./.github/workflows/pydpf-post.yml
219218 needs : pick_server_suffix
220219 with :
221220 ANSYS_VERSION : ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
222- post_branch : " master "
221+ post_branch : " main "
223222 standalone_suffix : ${{needs.pick_server_suffix.outputs.suffix}}
224223 test_docstrings : " true"
225224 secrets : inherit
@@ -229,7 +228,7 @@ jobs:
229228 if : |
230229 github.event.action != 'closed' &&
231230 (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)
231+ (startsWith(github.head_ref, 'main ') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
233232 strategy :
234233 fail-fast : false
235234 matrix :
@@ -248,3 +247,39 @@ jobs:
248247 DOCSTRING : false
249248 standalone_suffix : ${{ matrix.dpf.standalone-suffix }}
250249 secrets : inherit
250+
251+ sync-main-with-master :
252+ name : " Sync main with master"
253+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
254+ runs-on : ubuntu-latest
255+ steps :
256+ - name : " Install Git and clone project"
257+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
258+ with :
259+ token : ${{ secrets.GITHUB_TOKEN }}
260+ fetch-depth : 0
261+
262+ - name : " Verify that main is the default branch"
263+ shell : bash
264+ run : |
265+ head_branch=$(git remote show origin | grep "HEAD branch:")
266+ main_branch=${head_branch#*: }
267+
268+ if [[ $main_branch != "main" ]]; then
269+ echo "The default branch is not 'main'. It is set to '$main_branch'."
270+ echo "Please set 'main' as the default branch in the repository settings."
271+ exit 1
272+ fi
273+
274+ - name : " Configure git username and email"
275+ shell : bash
276+ run : |
277+ git config --global user.name "${{ secrets.PYANSYS_CI_BOT_USERNAME }}"
278+ git config --global user.email "${{ secrets.PYANSYS_CI_BOT_EMAIL }}"
279+
280+ - name : " Sync main to master"
281+ shell : bash
282+ run : |
283+ git checkout master
284+ git reset --hard main
285+ git push
0 commit comments