Merge pull request #72 from openclassify/register-event-end-trait-added #72
Workflow file for this run
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: Push to Another GitHub Repository | |
on: | |
push: | |
paths: | |
- 'docs/en/**' | |
env: | |
TARGET_REPO: MostafaMoradii/openclassify-docs | |
TARGET_BRANCH: connect-module-docs-$(date) | |
GH_USERNAME: ${{ secrets.GITHUB_USERNAME }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
deploy_to_github: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Copy modified file | |
run: | | |
cp ${{ github.workspace }}/addons/modules/connect . | |
- name: Set up Git | |
uses: webfactory/ssh-agent@v0.5.0 | |
with: | |
ssh-private-key: ${{ secrets.GITHUB_SSH_KEY }} | |
env: | |
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no | |
- name: Push to target repository | |
run: | | |
git config --global user.email $GH_USERNAME | |
git config --global user.name $GH_USERNAME | |
git remote add target_repo "https://${GH_USERNAME}:${GH_TOKEN}@github.com/${TARGET_REPO}.git" | |
git fetch target_repo | |
git checkout -b target_branch | |
git add . | |
git commit -m "Update file" | |
git push target_repo target_branch | |
- name: Open pull request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Update file | |
title: Update file | |
body: This pull request updates the file. | |
branch: target_branch |