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

Need some help #396

Open
markgov opened this issue Feb 16, 2024 · 2 comments
Open

Need some help #396

markgov opened this issue Feb 16, 2024 · 2 comments

Comments

@markgov
Copy link

markgov commented Feb 16, 2024

i am trying to create a new workflow to do a fmt and a plan but the init is failing
this is my code
name: Terraform plan

on:
pull_request:
# Sequence of patterns matched against refs/heads
branches:
- main

jobs:
terraform_pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Set up AWS credentials
  uses: aws-actions/configure-aws-credentials@v1
  with:
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
    aws-region: eu-west-2
- uses: hashicorp/setup-terraform@v3

- name: Terraform fmt
  id: fmt
  run: terraform fmt -check
  working-directory: terraform/
  continue-on-error: true

- name: Terraform Init
  id: init
  run: terraform init
  working-directory: terraform/

- name: Terraform Validate
  id: validate
  run: terraform validate -no-color
  working-directory: terraform/

- name: Terraform Plan
  id: plan
  run: terraform plan -no-color
  working-directory: terraform/
  continue-on-error: true

this is the error
https://github.com/mk1micros/awsbuild/actions/runs/7932809272/job/21660109945?pr=44

where am i going wrong?

@markgov
Copy link
Author

markgov commented Feb 16, 2024

this is the error incase the url does not let you see it
Run terraform init
terraform init
shell: /usr/bin/bash -e {0}
env:
AWS_DEFAULT_REGION: eu-west-2
AWS_REGION: eu-west-2
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
TERRAFORM_CLI_PATH: /home/runner/work/_temp/17157bf9-6484-4cb0-bd4e-5c6b70d72f66


│ Error: failed to get shared config profile, default


Initializing the backend...

Error: Terraform exited with code 1.
Error: Process completed with exit code 1.

@markgov
Copy link
Author

markgov commented Feb 16, 2024

i don't have any workspaces and i can run a plan locally on my pc and it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant