my company has created a complex way to move files between environments and now we would like to move certain built JS files (transpiled and minified) from one github repo to another. Is this possible using github actions?
$ git commit -m "Move file to new directory" # Commits the tracked changes and prepares them to be pushed to a remote repository. # To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again. Push the changes in your local repository to GitHub.com.
To copy the contents of a file, navigate to the file and click the Copy raw contents button on the toolbar: This feature is available in most desktop web browsers. Learn more about working with files.
Merge the files into the new repository B. Step 2: Go to that directory. Step 3: Create a remote connection to repository A as a branch in repository B. Step 4: Pull files and history from this branch (containing only the directory you want to move) into repository B.
The simplest option is to clone the target repo, copy the files into the target repo, use the git commandline to stage the files and then commit them. Add the code below in a script step
run: |
git clone https://.:${{ secrets.GITHUB_TOKEN }}@github.com/project target
rm everything but the .git directory
copy source\files target
cd target
git add .
git diff-index --quiet HEAD || git commit -m "Automatic publish from github.com/project"
git push target master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With