Skip to content

Add sync workflow to push changes to Codeup repository #1

Add sync workflow to push changes to Codeup repository

Add sync workflow to push changes to Codeup repository #1

Workflow file for this run

name: Sync to Codeup
on:
push:
branches:
- main
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checking out GitHub repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Pushing to another repository
if: ${{ secrets.TARGET_REPO }}

Check failure on line 18 in .github/workflows/sync.yml

View workflow run for this annotation

GitHub Actions / Sync to Codeup

Invalid workflow file

The workflow is not valid. .github/workflows/sync.yml (Line: 18, Col: 11): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.TARGET_REPO
env:
TARGET_REPO: ${{ secrets.TARGET_REPO }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa codeup.aliyun.com >> ~/.ssh/known_hosts
git remote add target "$TARGET_REPO"
git push target HEAD:main --force