Giter VIP home page Giter VIP logo

Comments (8)

dflook avatar dflook commented on June 7, 2024

The path variable should be set to the path to the terraform root module to run the plan for.
It looks like you are trying to output the plan to a file? The plan action does not support that at the moment.

from terraform-github-actions.

itsmesuniljacob avatar itsmesuniljacob commented on June 7, 2024

Hi @dflook ,

Below is my repo
https://github.com/ebomart/commerce-infrastructure/tree/plan_action

I was trying to set path as below

    - name: plan-dev
      uses: dflook/[email protected]
      env:
        GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
      with:
        path: ./
        var_file: environment/dev/variables.tfvars

But the same does not seem to work.

It would be really helpful , if you advise on the same

from terraform-github-actions.

dflook avatar dflook commented on June 7, 2024

That is correct as far as I can tell. What error are you getting?

from terraform-github-actions.

itsmesuniljacob avatar itsmesuniljacob commented on June 7, 2024

@danielflooktech ,

Below is the o/p

Run dflook/[email protected]
  with:
    path: ./
    var_file: environment/dev/variables.tfvars
    backend_config_file: environment/dev/gcs-bucket.tfvars
    workspace: default
    parallelism: 0
    add_github_comment: true
  env:
    CLOUDSDK_METRICS_ENVIRONMENT: github-actions-setup-gcloud
    GCLOUD_PROJECT: ***
    GOOGLE_APPLICATION_CREDENTIALS: /home/runner/work/commerce-infrastructure/commerce-infrastructure/f9b90f9d-4559-42ea-94db-486c1cf74f61
    GITHUB_TOKEN: ***
/usr/bin/docker run --name danielflookterraformgithubactionsv141_886b5d --label da7a08 --workdir /github/workspace --rm -e CLOUDSDK_METRICS_ENVIRONMENT -e GCLOUD_PROJECT -e GOOGLE_APPLICATION_CREDENTIALS -e GITHUB_TOKEN -e INPUT_PATH -e INPUT_VAR_FILE -e INPUT_BACKEND_CONFIG_FILE -e INPUT_WORKSPACE -e INPUT_BACKEND_CONFIG -e INPUT_VAR -e INPUT_PARALLELISM -e INPUT_LABEL -e INPUT_ADD_GITHUB_COMMENT -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true --entrypoint "/entrypoints/plan.sh" -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/commerce-infrastructure/commerce-infrastructure":"/github/workspace" danielflook/terraform-github-actions:v1.4.1

Reading required version from terraform file, constraint: >= 1.0.3
Switched terraform to version "1.0.4" 
Usage: terraform [global options] init [options]

  Initialize a new or existing Terraform working directory by creating
  initial files, loading any remote state, downloading modules, etc.

  This is the first command that should be run for any new or existing
  Terraform configuration per machine. This sets up all the local data
  necessary to run Terraform that is typically not committed to version
  control.

  This command is always safe to run multiple times. Though subsequent runs
  may give errors, this command will never delete your configuration or
  state. Even so, if you have important information, please back it up prior
  to running this command, just in case.

Options:

  -backend=true           Configure the backend for this configuration.

  -backend-config=path    This can be either a path to an HCL file with key/value
                          assignments (same format as terraform.tfvars) or a
                          'key=value' format. This is merged with what is in the
                          configuration file. This can be specified multiple
                          times. The backend type must be in the configuration
                          itself.

  -force-copy             Suppress prompts about copying state data. This is
                          equivalent to providing a "yes" to all confirmation
                          prompts.

  -from-module=SOURCE     Copy the contents of the given module into the target
                          directory before initialization.

  -get=true               Download any modules for this configuration.

  -input=true             Ask for input if necessary. If false, will error if
                          input was required.

  -no-color               If specified, output won't contain any color.

  -plugin-dir             Directory containing plugin binaries. This overrides all
                          default search paths for plugins, and prevents the
                          automatic installation of plugins. This flag can be used
                          multiple times.

  -reconfigure            Reconfigure the backend, ignoring any saved
                          configuration.

  -migrate-state          Reconfigure the backend, and attempt to migrate any
                          existing state.

  -upgrade=false          If installing modules (-get) or plugins, ignore
                          previously-downloaded objects and install the
                          latest version allowed within configured constraints.

  -lockfile=MODE          Set a dependency lockfile mode.
                          Currently only "readonly" is valid.

  -ignore-remote-version  A rare option used for the remote backend only. See
                          the remote backend documentation for more information.

from terraform-github-actions.

dflook avatar dflook commented on June 7, 2024

You are using the [email protected], which is too old for Terraform 1.0.x. Update to the latest version (1.13.0) and try again.

from terraform-github-actions.

itsmesuniljacob avatar itsmesuniljacob commented on June 7, 2024

@danielflooktech , It working correctly now.

Can I use the same version for apply as well?

from terraform-github-actions.

dflook avatar dflook commented on June 7, 2024

Yes. Consider using the action@v1 to use the latest.

from terraform-github-actions.

itsmesuniljacob avatar itsmesuniljacob commented on June 7, 2024

Thanks for your advise @dflook

from terraform-github-actions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.