Amplify on Github Workflow requires authentication

74 views Asked by At

I am trying to create a Github Workflow to automate the process of updating 2 amplify backend functions. However, every time I try to pull/push the project, it prompts the action with a URL to authenticate, which I obviously cannot use since I am not in control of the terminal. I am authenticating using this action: https://github.com/aws-actions/configure-aws-credentials, but the issue persists. This is the current state of my workflow:

name: Deploy Amplify Slack Lambdas
on:
  workflow_dispatch:
  push:
    branches:
      - main
jobs:
  deploy:
    permissions:
      id-token: write
      contents: read
    runs-on: ubuntu-latest
    env:
      AWS_IAM_ROLE_ARN: arn:aws:iam::*******:role/***** # censored for security reasons
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: 18
      - name: Configure AWS credentials with OIDC
        id: login-aws
        uses: aws-actions/configure-aws-credentials@v2
        with:
          role-to-assume: ${{ env.AWS_IAM_ROLE_ARN }}
          aws-region: eu-west-1
      - name: Install Amplify CLI
        run: |
          npm i -g @aws-amplify/cli
      - name: Pull current state
        run: |
          mkdir temp-deploy
          cd temp-deploy
          amplify pull --appId d7eiw0gt583y5 --envName staging --yes
      - name: Copy functions
        run: |
          cp ../lambdas/officeAttendanceSlackMain/* amplify/backend/function/officeAttendanceSlackMain/src/
          cp ../lambdas/officeAttendanceSlackWorker/* amplify/backend/function/officeAttendanceSlackWorker/src/
      - name: Push new state
        run: |
          amplify push --yes

0

There are 0 answers