Skip to content
Draft
1 change: 1 addition & 0 deletions doc/source/changelog/1168.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\`hk-migrate-fork-pr\` action
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
hk-migrate-fork-pr:
name: "Migrate fork PR to main repository"
runs-on: ubuntu-latest
# Only runs on issue comments
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
(contains(github.event.comment.body, '@pyansys-ci-bot migrate') ||
contains(github.event.comment.body, '@pyansys-ci-bot sync'))
permissions:
contents: write
pull-requests: write
steps:
- name: "Migrate fork PR"
uses: ansys/actions/hk-migrate-fork-pr@{{ version }}
with:
pr-number: ${{ '{{ github.event.issue.number }}' }}
comment-id: ${{ '{{ github.event.comment.id }}' }}
user-triggering: ${{ '{{ github.event.comment.user.login }}' }}
github-token: ${{ '{{ secrets.PYANSYS_CI_BOT_TOKEN }}' }}
bot-username: ${{ '{{ secrets.PYANSYS_CI_BOT_USERNAME }}' }}
bot-email: ${{ '{{ secrets.PYANSYS_CI_BOT_EMAIL }}' }}
team-slug: 'pyansys-maintainers'
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
hk-migrate-fork-pr-with-conflicts:
name: "Migrate fork PR with conflict resolution"
runs-on: ubuntu-latest
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request != null &&
(contains(github.event.comment.body, '@pyansys-ci-bot migrate') ||
contains(github.event.comment.body, '@pyansys-ci-bot sync'))
permissions:
contents: write
pull-requests: write
steps:
- name: "Migrate fork PR with explicit conflict mode"
uses: ansys/actions/hk-migrate-fork-pr@{{ version }}
with:
pr-number: ${{ '{{ github.event.issue.number }}' }}
comment-id: ${{ '{{ github.event.comment.id }}' }}
user-triggering: ${{ '{{ github.event.comment.user.login }}' }}
github-token: ${{ '{{ secrets.PYANSYS_CI_BOT_TOKEN }}' }}
bot-username: ${{ '{{ secrets.PYANSYS_CI_BOT_USERNAME }}' }}
bot-email: ${{ '{{ secrets.PYANSYS_CI_BOT_EMAIL }}' }}
team-slug: 'pyansys-maintainers'
# Override conflict resolution mode
# Options: 'auto' (fail on conflicts), 'theirs' (use fork branch), 'ours' (use main branch)
conflict-mode: 'theirs'
6 changes: 6 additions & 0 deletions doc/source/housekeeping-actions/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ Auto-merge pull requests

.. jinja:: hk-automerge-prs
:file: _templates/action.rst.jinja

Migrate fork pull requests
---------------------------

.. jinja:: hk-migrate-fork-pr
:file: _templates/action.rst.jinja
Loading
Loading