Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

cdk synth command should not require a GITHUB_TOKEN #61

Open
zaro0508 opened this issue Feb 7, 2023 · 3 comments
Open

cdk synth command should not require a GITHUB_TOKEN #61

zaro0508 opened this issue Feb 7, 2023 · 3 comments

Comments

@zaro0508
Copy link

zaro0508 commented Feb 7, 2023

I'm getting this error message that says i need a package.json file when attempting to run synth however I'm have a python project and i've already have a requirements.txt file containing the needed dependencies. I'm not sure why i need a package.json

Run youyo/aws-cdk-github-actions@v2
/usr/bin/docker run --name c3c9fab9b5f6b455f82604107fe244452_754adf --label 49859c --workdir /github/workspace --rm -e 
..
..
"/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/data_curator-infra/data_curator-infra":"/github/workspace" 49859c:3c9fab9b5f6b455f82604107fe244452
npm WARN saveError ENOENT: no such file or directory, open '/github/workspace/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/github/workspace/package.json'
npm WARN workspace No description
npm WARN workspace No repository field.
npm WARN workspace No README data
npm WARN workspace No license field.

+ [email protected]
added 1 package from 1 contributor and audited 1 package in 1.949s
found 0 vulnerabilities

Install aws-cdk latest
Successful install aws-cdk latest
Install requirements.txt
Successful install requirements.txt
Run cdk synth  "*"
Successfully synthesized to /github/workspace/cdk.out
Supply a stack id (dca-common, dca-test-DockerFargateStack) to display its template.

/entrypoint.sh: line 95: GITHUB_TOKEN: unbound variable

➜ tree

.
├── README.md
├── app.py
├── cdk.json
├── common
│   ├── __init__.py
│   └── vpc_stack.py
├── config.py
├── docker_fargate
│   ├── __init__.py
│   └── docker_fargate_stack.py
├── helpers.py
├── requirements-dev.txt
├── requirements.txt

➜ cat requirements.txt

aws-cdk-lib==2.60.0
constructs>=10.0.0,<11.0.0

my GH action jobs..

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Static Analysis
        uses: pre-commit/[email protected]

      - name: Install dependencies
        run: pip install -r requirements.txt -r requirements-dev.txt

      - name: cdk synth
        uses: youyo/aws-cdk-github-actions@v2
        with:
          cdk_subcommand: 'synth'
        env:
          DOCKER_IMAGE: ${{ env.IMAGE_PATH_AND_TAG }}
@zaro0508
Copy link
Author

zaro0508 commented Feb 7, 2023

OK. Adding a package.json file didn't fix the problem. I think real problem is /entrypoint.sh: line 95: GITHUB_TOKEN: unbound variable. Running CDK synth command does not require access to AWS however I think this error indicates that the aws-cdk-github-actions requires access?

@zaro0508 zaro0508 changed the title GH action requires package.json for python project cdk synth command should not require a GITHUB_TOKEN Feb 9, 2023
@paulmeier
Copy link

Ran into the same issue, try including actions_comment: false

@zaro0508
Copy link
Author

Thanks @paulmeier that worked.

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

No branches or pull requests

2 participants