Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
RustyTake-Off committed Jun 29, 2024
1 parent f63f229 commit 4823e9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
28 changes: 6 additions & 22 deletions .github/actions/templates/moveFiles/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,24 @@ runs:
id: move-files-to-branch
shell: bash
run: |
# Switch branch
### Switch branch
git checkout -b ${{ inputs.targetBranchName }} --track origin/${{ inputs.targetBranchName }} &>/dev/null
# Remove all files
### Remove all files
git rm -r . &>/dev/null
git reset &>/dev/null
# Checkout directories and files
### Checkout directories and files
git checkout ${{ inputs.sourceBranchName }} -- ${{ inputs.targetBranchName }}
[ -n "${{ inputs.otherSharedFiles }}" ] && \
git checkout ${{ inputs.sourceBranchName }} -- ${{ inputs.otherSharedFiles }}
[ -n "${{ inputs.otherDirs }}" ] && \
git checkout ${{ inputs.sourceBranchName }} -- ${{ inputs.otherDirs }}
# Copy directories and files
### Copy directories and files
cp -r "${{ inputs.targetBranchName }}"/* .
find "${{ inputs.targetBranchName }}" -maxdepth 1 -name '.*[!.]*' -exec cp -r {} . \;
echo '=========='
ls -al
echo '=========='
[ -n "${{ inputs.otherSharedFiles }}" ] && \
shopt -s dotglob && \
for item in ${{ inputs.otherSharedFiles }}; do
Expand All @@ -66,10 +62,6 @@ runs:
done
shopt -u dotglob
echo '=========='
ls -al
echo '=========='
[ -n "${{ inputs.otherDirs }}" ] && \
shopt -s dotglob && \
for item in ${{ inputs.otherDirs }}; do
Expand All @@ -79,11 +71,7 @@ runs:
done
shopt -u dotglob
echo '=========='
ls -al
echo '=========='
# Clean up
### Clean up
rm -rf ${{ inputs.targetBranchName }}
rm README.md
Expand All @@ -101,11 +89,7 @@ runs:
fi
done
echo '=========='
ls -al
echo '=========='
# Commit and push
### Commit and push
git config --global user.name ${{ inputs.userName }}
git config --global user.email ${{ inputs.userEmail }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/dot.move-winfiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
paths:
- '.github/**'
- 'docs/images/**'
- 'genfiles/images/**'
- 'winfiles/**'
- '!winfiles/README.md'

Expand All @@ -19,7 +19,7 @@ permissions:

env:
targetBranchName: 'winfiles'
otherSharedFiles: 'genfiles/browsers genfiles/vscode/vscode.json wslfiles/.config/starship.toml' # space separated
otherSharedFiles: '' # space separated
otherDirs: 'genfiles/images' # space separated

jobs:
Expand All @@ -36,7 +36,6 @@ jobs:
- name: 'Move ${{ env.targetBranchName }} branch files'
id: move-branch-files
uses: ./.github/actions/templates/moveFiles
# continue-on-error: true
with:
targetBranchName: ${{ env.targetBranchName }}
otherSharedFiles: ${{ env.otherSharedFiles }}
Expand Down

0 comments on commit 4823e9f

Please sign in to comment.