Sync upstream branch #7
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: Sync upstream branch | |
on: | |
schedule: | |
- cron: '14 6 * * *' | |
workflow_dispatch: | |
inputs: | |
cmd: | |
type: string | |
description: 'Custom commands' | |
required: false | |
default: '' | |
# permissions: | |
# contents: write | |
concurrency: | |
group: "sync" | |
cancel-in-progress: false | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
# uses: actions/checkout@v4 | |
# with: | |
# ref: upstream | |
# ${{ secrets.PAT }}: akku's personal token | |
run: | | |
cat > /tmp/key.private << EOL | |
${{ secrets.SYNC_PRIVATE_KEY }} | |
EOL | |
chmod 600 /tmp/key.private | |
git clone --depth=1 -b upstream \ | |
-c "core.sshCommand=ssh -i /tmp/key.private -F /dev/null" \ | |
'git@github.com:${{ github.repository }}' . | |
- name: Custom commands | |
if: ${{ inputs.cmd != '' }} | |
run: ${{ inputs.cmd }} | |
# ex: git fetch --depth=10 && git reset --hard 31e00b2fafa14a310fef63008e2e99dad97eb1d3 && git push -f | |
- name: Git | |
run: | | |
set -x | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git remote add up https://github.com/evex-dev/scratch-gui-vite.git | |
# git switch -c upstream | |
git pull up develop | |
git push -u origin upstream | |
git push |