GithubHelp home page GithubHelp logo

Comments (11)

ShahradR avatar ShahradR commented on August 29, 2024

By including a sample workflow under .github/workflows/main.yaml, we are able to simulate the action's execution using act.

asciicast

To run the action without pushing code to a repository, set uses: ./ in the workflow definition, as shown below.

---
on: [push]

jobs:
  taskcat:
    runs-on: ubuntu-latest
    name: Validate CloudFormation templates
    steps:
      - name: Run taskcat
        id: taskcat
        uses: ./

The file and folder structure used for the test above is shown below.

.
├── .gitattributes
├── .github
│   └── workflows
│       └── main.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── .taskcat.yml
├── Dockerfile
├── LICENSE
├── README.md
├── action.yaml
├── commitlint.config.js
└── templates
    └── my-template.yaml

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

We currently aren't able to provision an AWS account for end-to-end testing (see #3). Since the remaining work in this MVP depends on taskcat's ability to connect to an AWS account and create CloudFormation resources, this issue is on hold until #3 is resolved.

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

The AWS account creation issue outlined in #3 has been resolved by adding the user to the Service Catalog portfolio. Additionally, I wrote a quick gist around AWS Control Tower setup, for future reference.

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

Commit 27f8287 removes the inputs section of the action.yaml file, allowing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables to be properly passed to the taskcat Docker container.

GitHub Action inputs are prefixed with INPUT_. For example, when passing the AWS_ACCESS_KEY_ID, it would appear to the container as INPUT_AWS_ACCESS_KEY_ID, which taskcat does not recognize.

By removing the inputs from the file, the environment variables are passed as-is, resolving the issue.

In the .github/workflows/main.yaml file that consumes the action, we also need to change how the credentials are passed in. The changes are highlighted below.

Before change

---
on: [push]

jobs:
  taskcat:
    runs-on: ubuntu-latest
    name: taskcat
    steps:
      - name: taskcat
        id: taskcat
        uses: ./
        with:
          aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
          aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}

After change

---
on: [push]

jobs:
  taskcat:
    runs-on: ubuntu-latest
    name: taskcat
    steps:
      - name: Run taskcat
        id: taskcat
        uses: ./
        env:
          AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
          AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
          AWS_SESSION_TOKEN: ${{secrets.AWS_SESSION_TOKEN}}

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

Note that because I am using landing zones with the AWS Security Token Service (STS), I also need to pass the AWS_SESSION_TOKEN environment variable in addition to the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables.

In my case, the session token can be retrieved by visiting the AWS Single Sign-On page, and clicking on Command line or programmatic access.

image

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

Opened #5 after determining that act is unable to render certain outputs. Tried running the action through GitHub itself to see if the output limitation is limited to act. However, the action.yaml file is incorrectly referencing the Docker container, preventing the workflow from even running. #6 was opened to track that work.

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

#6 has been resolved by properly referencing the Dockerfile in the action.yaml.

from action-taskcat.

ShahradR avatar ShahradR commented on August 29, 2024

With the Dockerfile updated to pipe taskcat output to cat, act now works as expected. #5 has been resolved and closed.

asciicast

from action-taskcat.

github-actions avatar github-actions commented on August 29, 2024

🎉 This issue has been resolved in version 1.0.0-develop.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from action-taskcat.

github-actions avatar github-actions commented on August 29, 2024

🎉 This issue has been resolved in version 1.0.0-develop.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from action-taskcat.

github-actions avatar github-actions commented on August 29, 2024

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from action-taskcat.

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.