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

Deployment via Github Actions Failing #427

Closed
cfarmer-fearless opened this issue Feb 14, 2022 · 1 comment
Closed

Deployment via Github Actions Failing #427

cfarmer-fearless opened this issue Feb 14, 2022 · 1 comment

Comments

@cfarmer-fearless
Copy link

cfarmer-fearless commented Feb 14, 2022

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request 
[ ] Other... Please describe: 

I would like to do automated deployments with Github Actions and the ask cli. This is for a self hosted skill in a Lambda function. The lambda function has already been created, and the alexa skill trigger has been configured using the correct skill ID. Here is my github action configuration yml file:

name: Hello World
on: [push]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout and deploy to dev
        uses: actions/checkout@v2
      - run: |
          sudo npm install -g ask-cli;
          cd lambda;
          npm install;
      - run: ask deploy --ignore-hash
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          ASK_ACCESS_TOKEN: ${{ secrets.ASK_ACCESS_TOKEN }}
          ASK_REFRESH_TOKEN: ${{ secrets.ASK_REFRESH_TOKEN }}
          ASK_VENDOR_ID: ${{ secrets.ASK_VENDOR_ID }}
          ASK_DEFAULT_PROFILE: default
          SKILL_ID: ${{ secrets.SKILL_ID }}

And here is my skills.json:

{
  "manifest": {
    "publishingInformation": {
      "locales": {
        "en-US": {
          "summary": "Sample Short Description",
          "examplePhrases": [
            "Alexa open hello world",
            "hello",
            "help"
          ],
          "name": "skill-sample-nodejs-hello-world",
          "description": "Sample Full Description"
        }
      },
      "isAvailableWorldwide": true,
      "testingInstructions": "Sample Testing Instructions.",
      "category": "KNOWLEDGE_AND_TRIVIA",
      "distributionCountries": []
    },
    "apis": {
      "custom": {
        "endpoint": {
          "uri": "<LAMBDA ARN>"
        }
      }
    },
    "manifestVersion": "1.0"
  }
}

Expected Behavior

The ask deploy command runs when a push is made to the main branch. The deploy command completes successfully and updates the skill.

Current Behavior

The deploy command fails with the following message:

"skill": {
    "resources": [
      {
        "action": "CREATE",
        "errors": [
          {
            "message": "The trigger setting for the Lambda <LAMBDA ARN> is invalid."
          }
        ],
        "name": "Manifest",
        "status": "FAILED"
      }
    ]
  },
  "status": "FAILED"

Steps to Reproduce (for bugs)

  1. Create a new alexa skill with the ask new command.
  2. Generate a lambda function and skill id by running ask deploy locally in the root directory of the new skill.
  3. Add the above github action configuration to the .github/workflows/action.yml file.
  4. Include the environment variables listed in this configuration in your github repo secrets.
  5. Push a new commit to the main branch.

Possible Solution

Your Environment and Context

  • ask-cli version: 2.26.0
  • Operating System and version: MacOS Monterey
  • Node.js version used for development: 12
  • NPM version used for development: 8.1.0
@cfarmer-fearless
Copy link
Author

I finally was able to get this working by adding the __ENVIRONMENT_ASK_PROFILE__ profile to the .ask/ask-states.json. Phew!

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