GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - oracle-actions/run-oci-cli-command: Run Oracle Cloud Infrastructure (OCI) CLI commands

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

33 Commits
33 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
dist
dist
 
 
script
script
 
 
src
src
 
 
.eslintignore
.eslintignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.node-version
.node-version
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.json
.prettierrc.json
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
THIRD_PARTY_LICENSES.txt
THIRD_PARTY_LICENSES.txt
 
 
action.yml
action.yml
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

run-oci-cli-command

This GitHub Action installs the OCI CLI and then runs the specified command. This action will automatically cache the OCI CLI install to speed up any subsequent steps that use this action.

Required environment variables

The following OCI CLI environment variables must be defined for at least the run-oci-cli-command task:

  • OCI_CLI_USER
  • OCI_CLI_TENANCY
  • OCI_CLI_FINGERPRINT
  • OCI_CLI_KEY_CONTENT
  • OCI_CLI_REGION

We recommend using GitHub Secrets to store these values. If you have more than one run-oci-cli-command task, consider defining your environment variables at the job or workflow level.

Inputs

  • command (required): the command and arguments to provide to the oci tool.
  • query: (optional) a JMESPath query to run on the response JSON before output.

Output masking

By default, the output(s) from the command are masked from the GitHub Actions log and GitHub console, to prevent leaking any credential or confidential information. The following option will disable that masking and is intended for debugging purposes only:

  • silent: (Optional; default: true) If set to false the action will not mask or suppress the command or outputs from the logs or console.

Note: the output does not need to be visible in the log to be used as an input by another task.

Outputs

  • output: will contain the results of the command.
  • raw_output: if the output of a given query is a single string value, raw_output will return the string without surrounding quotes.

Note: filtering the output or raw_output by piping it through another tool like jq may result in the filtered output being visible in the job logs. We recommend using the query parameter whenever possible.

If the result of the command is not valid JSON, it will not be visible unless silent is set to false.

Sample workflow

The following example lists all compute instances found in the testing compartment of the OCI_CLI_TENANCY in the OCI_CLI_REGION region.

To change the name of the compartment, modifying the query parameter of the find-compartment-id step.

To change which fields are returned, modify the query parameter of the find-instances step.

jobs:
  my-instances:
    runs-on: ubuntu-latest
    name: List the display name and shape of the instances in my compartment
    env:
      OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }}
      OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }}
      OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }}
      OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
      OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
    steps:
      - name: Retrieve the OCID of a named compartment in tenancy
        uses: oracle-actions/[email protected]
        id: find-compartment-id
        with:
          command: 'iam compartment list --compartment-id-in-subtree=true'
          query: "data[?name=='testing'].id"

      - name: Retrieve the display name and shape of the instances in my compartment
        uses: oracle-actions/[email protected]
        id: find-instances
        with:
          command: 'compute instance list --compartment-id ${{ steps.find-compartment-id.outputs.raw_output }}'
          query: 'data[*].{name: \"display-name\", shape: shape}'

      - name: List the display name and shape of the instances in my compartment
        run: |
          echo ${{ steps.find-instances.outputs.output }} | jq .

Consult the JMESPath documentation for details on how to create more complex queries and result formatting and action.yml for more detail on how to configure this action..

Contributing

We welcome contributions from the community. Before submitting a pull request, please review our contribution guide.

Security

Please consult the security guide for our responsible security vulnerability disclosure process.

License

Copyright (c) 2021, 2024, Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.

About

Run Oracle Cloud Infrastructure (OCI) CLI commands

Topics

actionsgithub-actionsoci-clioracle-cloudoracle-cloud-infrastructure

Resources

Readme
UPL-1.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

39 stars

Watchers

4 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.