-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RC for V1.2 #3
RC for V1.2 #3
Conversation
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
I tested it. Could not get it to work. Do you have a hint how to get it running with an ssh-key? Some notes: sshkey: If the key is written to
I tried to use I tried (Other hints on ssh keys are given at https://maxschmitt.me/posts/github-actions-ssh-key - however, I don't want to use an agent) Just as reference - with chocolatey, everything works: rsync installation takes about 30 seconds ( There, the permission issue with the ssh key does not occur. Part of the command:
Note the special location of Maybe, you could switch from the "invasive" cygwin installation to a simple choco installation? Maybe, the action can be paramterized: |
I gave up with cygwin and ssh. Tried around with
With some more work: - name: Setup ssh key
shell: bash
run: |
temp_path="${{ runner.temp }}"
temp_path="${temp_path//\\//}"
echo "${{ secrets.SSH_KEY }}" > "${temp_path}/sshkey"
chmod 600 "${{runner.temp}}/sshkey"
- name: rsync
shell: bash
run: |
temp_path="${{ runner.temp }}"
sshkeypath="${temp_path//\\//}/sshkey"
rsync -Pavz --itemize-changes --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /tmp/test && rsync" -e "ssh -i ${sshkeypath} -o StrictHostKeyChecking=no" build/distribution/ user@example.org:/tmp/test/ But then
Will use |
My job: jobs:
rsynctest:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup rsync
uses: GuillaumeFalourd/setup-rsync@test
- name: Setup ssh key
shell: bash
run: |
temp_path="${{ runner.temp }}"
temp_path="${temp_path//\\//}"
echo "${{ secrets.SSH_KEY }}" > "${temp_path}/sshkey"
chmod 600 "${{runner.temp}}/sshkey"
mkdir -p build/distribution/
touch build/distribution/test.txt
- name: rsync
shell: bash
run: |
temp_path="${{ runner.temp }}"
sshkeypath="${temp_path//\\//}/sshkey"
rsync -Pavz --itemize-changes --stats --partial-dir=/tmp/partial --rsync-path="mkdir -p /tmp/test && rsync" -e "ssh -i ${sshkeypath} -o StrictHostKeyChecking=no" build/distribution/ user@example.org:/tmp/test/ |
Hi @koppor , thank you for the insights! I'll move the action to use choco instead for windows in that case. EDIT: Seems to work, as can be seen here Would you find it helpful to have a not mandatory ssh key input to execute the following command during the action execution?
|
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments.
I would also modify the test workflow - one can use a local action.yml after checkout as action. See https://github.com/orgs/community/discussions/26245 for details.
action.yml
Outdated
echo "ubuntu runner detected" | ||
sudo apt-get install rsync | ||
echo "rsync installed on ubuntu runner" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always outputs that rsync is installed. Maybe, skip installation - and if GitHub updates the image - and removes rsync, this action can be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still let this part here as this action could be used on self-hosted
runner that may not have rsync
installed by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does one need apt-get update
before? - On "normal" docker images, this is required, because the indexes are normally wiped away to save space.
Some bookmarks to share:
- Run GitHub actions locally: https://github.com/nektos/act
- (rather small) Image with sudo: https://github.com/fwilhe2/act-runner-image
- act --rm --platform ubuntu-latest=fwilhe2/act-runner:latest -W Tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update this section in the action.yaml file if you want to have a look 👍🏼
else | ||
temp_path="${{ runner.temp }}" | ||
temp_path="${temp_path//\\//}" | ||
echo "${{ inputs.ssh_key }}" > "${temp_path}/sshkey" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, this did not work on Cygwin bash. Hopefully, it does on git bash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to identify if it's using cygwin or git before executing those commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment variable CYGWIN
is set in the case of the former.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update this section in the action.yaml file if you want to have a look 👍🏼
Sure! It would also be great if the path to the sshkey would be available as output of the action. In that way, one can "easily" use it as input for |
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
I'll add it 👍🏼 EDIT: Done |
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Merge workflows
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Signed-off-by: Guillaume Falourd <guillaume.falourd@zup.com.br>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Description
Closes #2
action.yaml
file to support Windows OS runners backEvidences
https://github.com/GuillaumeFalourd/setup-rsync/actions/runs/6253144375