Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed May 14, 2023
2 parents 3230ed6 + 75863c0 commit 85769ab
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 93 deletions.
61 changes: 54 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,71 @@ on:
workflow_dispatch:

jobs:
mirror:
mirror-normal:
runs-on: ubuntu-latest
name: mirror hg repo
permissions:
contents: read # This is required for actions/checkout
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 2
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/setup-node@v3
with:
python-version: 2.7
node-version: 'latest'
cache: 'npm'
- run: npm install
- run: npm run build

- name: do mirror action
- name: test mirror action 1
uses: ./ # Uses an action in the root directory
with:
source-hg-repo-url: 'https://foss.heptapod.net/pypy/cffi'
destination-git-repo-owner: 'mozillazg'
destination-git-repo-name: 'test-mirror-cffi'
destination-git-repo-name: 'cffi'
destination-git-personal-token: '${{ secrets.PERSONAL_GIT_TOKEN }}'

- name: test mirror action 2
uses: ./ # Uses an action in the root directory
with:
source-hg-repo-url: 'http://hg.code.sf.net/p/ruamel-yaml/code'
destination-git-repo-owner: 'mozillazg'
destination-git-repo-name: 'ruamel-yaml'
destination-git-personal-token: '${{ secrets.PERSONAL_GIT_TOKEN }}'

- name: test mirror action 3
uses: ./ # Uses an action in the root directory
with:
source-hg-repo-url: 'http://hg.code.sf.net/p/ruamel-yaml-clib/code'
destination-git-repo-owner: 'mozillazg'
destination-git-repo-name: 'ruamel-yaml-clib'
destination-git-personal-token: '${{ secrets.PERSONAL_GIT_TOKEN }}'

mirror-pypy:
runs-on: ubuntu-latest
name: mirror pypy
permissions:
contents: read # This is required for actions/checkout
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/setup-node@v3
with:
node-version: 'latest'
cache: 'npm'
- run: npm install
- run: npm run build

- name: test mirror pypy
uses: ./ # Uses an action in the root directory
with:
source-hg-repo-url: 'https://foss.heptapod.net/pypy/pypy'
destination-git-repo-owner: 'mozillazg'
destination-git-repo-name: 'pypy-mirror'
destination-git-personal-token: '${{ secrets.PERSONAL_GIT_TOKEN }}'
repo-style: 'pypy-style'
11 changes: 5 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ Example Usage

.. code-block:: yaml
- name: Set up Python 2
uses: actions/setup-python@v4
- uses: actions/setup-python@v4
with:
python-version: 2.7
python-version: '3.10'
- name: mirror https://foss.heptapod.net/pypy/cffi
uses: 'mozillazg/mirror-hg-repo@v1'
uses: 'mozillazg/mirror-hg-repo@v2'
with:
source-hg-repo-url: 'https://foss.heptapod.net/pypy/cffi'
destination-git-repo-owner: 'mozillazg'
Expand All @@ -26,10 +25,10 @@ Example Usage
Inputs
======

* ``source-hg-repo-url``: (**Required**) The clone URL of a Mercurial (hg) repository. e.g. https://foss.heptapod.net/pypy/cffi
* ``source-hg-repo-url``: (**Required**) The clone URL of a Mercurial (hg) repository. e.g. ``https://foss.heptapod.net/pypy/cffi``
* ``destination-git-repo-owner``: (**Required**) The owner of Github repository.
* ``destination-git-repo-name``: (**Required**) The name of Github repository.
* ``destination-git-personal-token``: (**Required**) A `Github personal access token`_ which have permission to push codes to the repository.
* ``force-push``: (Optional) Run ``git push`` command with the ``--force`` flag. The default value is: ``false``
* ``force-push``: (Optional) Run ``git push`` action with the ``--force`` flag. The default value is: ``false``

.. _Github personal access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ inputs:
description: ''
required: false
default: 'false'
repo-style:
description: 'normal or pypy-style'
required: false
default: 'normal'

branding:
icon: 'arrow-up-circle'
Expand Down
158 changes: 90 additions & 68 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 85769ab

Please sign in to comment.