Merge Repos Action #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Merge Repos Action | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install gitpython requests | |
- name: Run merge_repos.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
GIT_USER_NAME: "lsfreitas" | |
GIT_USER_EMAIL: "[email protected]" | |
TARGET_REPO_URL: "[email protected]:lsfreitas/target.git" | |
SOURCE_REPO_URL: "[email protected]:lsfreitas/source.git" | |
TARGET_BRANCH: "main" | |
SOURCE_BRANCH: "main" | |
run: | | |
python merge_repos.py |