Chore #40
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: Chore | |
on: | |
workflow_dispatch: | |
jobs: | |
chore_update_dist: | |
name: Sync binaries with upstream | |
runs-on: ubuntu-latest | |
env: | |
upstream_repo: github/copilot.vim | |
upstream_branch: release | |
upstream_dir: dist | |
dest_dir: dist | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Clone upstream branch | |
id: clone-upstream | |
run: | | |
mkdir .tmp | |
cd .tmp | |
git clone https://github.com/$upstream_repo.git --filter=tree:0 upstream | |
cd upstream | |
cp ./$upstream_dir ../../ -rf | |
echo "commit_msg=`git log -n 1 --format=%B ./$upstream_dir`" >> "$GITHUB_OUTPUT" | |
- name: Sync | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add $dest_dir/ | |
git commit -am "${{ steps.clone-upstream.outputs.commit_msg }}" && git push origin || (exit 0) |