-
Notifications
You must be signed in to change notification settings - Fork 461
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
Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers #990
Comments
Hi @gulskr thanks for reaching out. Can you provide your full code in YAML format, for us to make sure we try to reproduce this with the identical steps you've taken? To further expand on the reason why I'm requesting a full code in YAML format - the indentation matters in YAML and I cannot tell the correct levels of indentation based on the unformatted text you provided, therefore making this difficult to reproduce. I'll also note that the And for future reference we ask that you do not tag various users to look at an issue. As long as the |
This is the reuisable workflow YAML code and one more when i tried to run the workflow without reusable workflow it work fine on: env:AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}jobs:
This is the yaml file where i am calling that reusable workflow on: allow use id-tokenpermissions: jobs: |
Thanks @gulskr for following up. I'm still having trouble reproducing this issue. Here is an example from the README: - name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }}
role-duration-seconds: 1200
role-session-name: MySessionName Here is a screenshot of what the code snippet markdown format looks like this, surrounded by backticks: If you can encapsulate your code snippets in that format, that will greatly help with investigating the issue. Could you also expand on this point for clarification?
If you can point out specifically what is working and not working from your examples, that can help us narrow down the issue here. Thanks, |
Okay, thanks for replying, Now I will elaborate everything what I am trying to achieve.
=================================================================================
=> I don't know why this is a very strange problem I am facing, because When i try to run the workflow without using reusable workflow then it is working fine, like this in the code below
|
A update on this issue while calling the reusable workflow, you just have to add secrets: inherit in the workflow then it will fetch the credentials, see in the below code and match it from the above where the changes been made, thanks @tim-finnigan for your help.
|
Comments on closed issues are hard for our team to see. |
Describe the bug
Okay, so I have created a reusable workflow for all my business jobs and and I am calling the reusable workflow in other repo within a private repo. When I try to run this workflow on github action, it throws a very strange error, credentials could not be loaded, but when I run the workflow without calling reusable it fetch the credential and works fine, Can anyone help me with this issue. @aws-dash @aws-sdk-osds @kanchana-aws @smithy
Expected Behavior
I expect to run this workflow and able to fetch the credentials.
Current Behavior
Reproduction Steps
Okay so i will provide you code and everything,
jobs:
start_ec2:
runs-on: ubuntu-latest
steps:
name: Check User
run: |
echo "GitHub Actor: $GITHUB_ACTOR"
name: Debug AWS Credentials
run: |
echo "AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}"
echo "AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}"
name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
uses: actions/setup-python@v5
with:
python-version: '3.10'
name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
name: Generate Date and Time - build
id: date-time-ecr
run: |
echo "output=$(date +'%d-%m-%y-%H-%M-%S')" >> $GITHUB_OUTPUT
name: install boto3
run: |
pip install boto3
name: run
run: |
python automation-scripts/aws/start_resources_ec2_rds.py
This is the workflwo where i am calling this reusable workflow:
name: Start AWS EC2 & RDS - Reusable
run-name: Build initiated by ${{ github.actor }} for branch ${{inputs.branch}}
on:
workflow_dispatch:
inputs:
branch:
description: 'Select Branch'
required: true
default: 'main'
type: choice
options:
allow use id-token - also i have tried with this and without works same
permissions:
id-token: write # required!
contents: read
jobs:
call-workflow-passing-data:
uses: user-name/repo-name/.github/workflows/reusable_workflow.yml@main
Possible Solution
I think maybe it has something to do with the aws credentials but i don't have much idea.
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: