-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Description
I am trying to use this action to plan out a creation of a GIthub repository in our organization. I have followed the examples as they were written in the README, and once I got some of the standard config cleaned up, I started to get an error that pipenv wasn't installed which caused cdktf to fail. I then tried to ensure that pipenv was installed, and after it was installed, pipenv would say that it couldn't install cdktf.
Here is the action:
name: "Comment a Plan on a PR"
on: [pull_request]
permissions:
contents: read
pull-requests: write
jobs:
terraform:
name: "Terraform CDK Diff"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install pipenv
run: pip install pipenv
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Generate module and provider bindings
run: npx cdktf-cli get
- name: Run Terraform CDK
uses: hashicorp/terraform-cdk-action@v5
with:
cdktfVersion: 0.20.10
terraformVersion: 1.5.7
mode: plan-only
stackName: terraform-cdk-github-python-ex
githubToken: ${{ steps.generate-token.outputs.token }}
cdktfArgs: --var='github_Oauth_token=${{ steps.generate-token.outputs.token }}'
Here is the output to the failu of the Generate Module and provider bindings
Run npx cdktf-cli get
npx cdktf-cli get
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.11.10/x64
npm warn exec The following package was not found and will be installed: cdktf-cli@0.[2](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:2)0.10
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.[3](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:3): Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
Creating a virtualenv for this project
Error: 02[4](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:4)-11-26T21:0[5](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:5):01.137] [ERROR] default - Creating a virtualenv for this project
Pipfile:
Error: 024-11-2[6](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:7)T21:05:01.140] [ERROR] default - Pipfile:
/home/runner/work/terraform-cdk-github-python-ex/terraform-cdk-github-python-ex/
Pipfile
/home/runner/work/terraform-cdk-github-python-ex/terraform-cdk-github-python-ex/
Pipfile
Using /opt/hostedtoolcache/Python/3.11.10/x64/bin/python33.11.10 to create
virtualenv...
Error: 024-11-26T21:05:01.154] [ERROR] default - Using /opt/hostedtoolcache/Python/3.11.10/x64/bin/python33.11.10 to create
virtualenv...
created virtual environment CPython3.11.10.final.0-64 in [7](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:8)34ms
Error: 024-11-26T21:05:02.138] [ERROR] default - created virtual environment CPython3.11.10.final.0-64 in 734ms
creator
creator
CPython3Posix(dest=/home/runner/.local/share/virtualenvs/terraform-cdk-github-py
CPython3Posix(dest=/home/runner/.local/share/virtualenvs/terraform-cdk-github-py
thon-ex-y3r-VrWV, clear=False, no_vcs_ignore=False, global=False)
thon-ex-y3r-VrWV, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
seeder FromAppData(download=False, pip=bundle, setuptools=bundle,
wheel=bundle, via=copy, app_data_dir=/home/runner/.local/share/virtualenv)
wheel=bundle, via=copy, app_data_dir=/home/runner/.local/share/virtualenv)
added seed packages: pip==24.3.1, setuptools==75.6.0, wheel==0.45.1
added seed packages: pip==24.3.1, setuptools==75.6.0, wheel==0.45.1
activators
activators
BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator
BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator
,PythonActivator
,PythonActivator
Successfully created virtual environment!
Error: 024-11-26T21:05:02.143] [ERROR] default - Successfully created virtual environment!
Virtualenv location: /home/runner/.local/share/virtualenvs/terraform-cdk-github-python-ex-y3r-VrWV
Error: 024-11-26T21:05:02.230] [ERROR] default - Virtualenv location: /home/runner/.local/share/virtualenvs/terraform-cdk-github-python-ex-y3r-VrWV
WARNING: Package(s) not found: cdktf
Error: 024-11-26T21:05:03.624] [ERROR] default - WARNING: Package(s) not found: cdktf
WARNING: Package(s) not found: cdktf
Error: 024-11-26T21:05:04.1[8](https://github.com/simplifi-dev/terraform-cdk-github-python-ex/actions/runs/12038987736/job/33565855084?pr=1#step:8:9)1] [ERROR] default - WARNING: Package(s) not found: cdktf
Generated python constructs in the output directory: imports
Are there any examples of how this can work with a python approach?
GitHub Action Version
v4.2.2
Configuration
cdktfVersion: 0.20.10
terraformVersion: 1.5.7
mode: plan-only
stackName: terraform-cdk-github-python-ex
githubToken: ${{ steps.generate-token.outputs.token }}
cdktfArgs: --var='github_Oauth_token=${{ steps.generate-token.outputs.token }}'
Gist
No response
Possible Solutions
No response
Workarounds
Installing pipenv first solved one issues, but now pipenv can't find cdktf.
Anything Else?
No response
References
No response
Help Wanted
- I'm interested in contributing a fix myself
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment