Skip to content
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

Output of ssh command #36

Open
itsmesuniljacob opened this issue Nov 25, 2022 · 1 comment
Open

Output of ssh command #36

itsmesuniljacob opened this issue Nov 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@itsmesuniljacob
Copy link

TL;DR

Is there a way to get output of commands?

    - id: 'compute-ssh'
      uses: 'google-github-actions/ssh-compute@v0'
      with:
        instance_name: test-instance
        zone: asia-south1-c
        ssh_private_key: '${{ secrets.SSH_KEY }}'
        command: 'composer -V'

Expected behavior

composer -V
Composer version 2.4.4 2022-10-27 14:39:29

Observed behavior

No output

Action YAML

name: Build and Deploy to GCE
on:
  workflow_dispatch:
      inputs:
        logLevel:
          description: environment   
          required: true
          default: stg

env:
  PROJECT_ID: ${{ secrets.GCP_PROJECT }}
  GCE_INSTANCE: test-instance
  GCE_INSTANCE_ZONE: asia-south1-c

jobs:
  setup-build-publish-deploy:
    name: Setup, Build, Publish, and Deploy
    runs-on: ubuntu-latest

    # Add "id-token" with the intended permissions.
    permissions:
      contents: 'read'
      id-token: 'write'

    steps:
    - name: Checkout
      uses: actions/checkout@v3

    # Alternative option - authentication via credentials json
    - id: 'auth'
      uses: 'google-github-actions/auth@v1'
      with:
        credentials_json: '${{ secrets.CREDENTIALS_VM_STG }}'

    - id: 'compute-ssh'
      uses: 'google-github-actions/ssh-compute@v0'
      with:
        instance_name: test-instance
        zone: asia-south1-c
        ssh_private_key: '${{ secrets.SSH_KEY }}'
        command: 'composer -V'


### Log output

```text
Running: gcloud compute ssh test-instance --zone asia-south1-c --ssh-key-file /tmp/0bbff49169572489822e4f40/google_compute_engine --quiet --tunnel-through-iap --command bash -c "composer -V"


### Additional information

Is there anyway to get output?
@itsmesuniljacob itsmesuniljacob added the bug Something isn't working label Nov 25, 2022
@barend
Copy link

barend commented Apr 7, 2023

This is in the readme file, look for "Example of using the output" in the yaml sample code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants