cloudformation-guard icon indicating copy to clipboard operation
cloudformation-guard copied to clipboard

[github action] action fails - gh auth login

Open luiscosta18 opened this issue 3 months ago • 1 comments

Describe the issue

My github repository is private.

Github token for workflows is created https://docs.github.com/en/actions/concepts/security/github_token

Image

The action is failing

Image
name: Cloudformation - Validate
on:          
  pull_request:

permissions:
  contents: read
  issues: read
  checks: write
  pull-requests: write
  id-token: write      

env:
  AWS_REGION: eu-central-1

jobs:
  cfn-aguard:
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request'
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v5
        with:
          fetch-depth: 0

      - name: Run cfn-guard
        uses: aws-cloudformation/[email protected]
        with:
          rules: './cf_rules'
          data: './cf_templates'
          analyze: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Operating System: [Ubuntu]

Cc @joshfried-aws @dannyvassallo

luiscosta18 avatar Oct 07 '25 11:10 luiscosta18

https://github.com/aws-cloudformation/cloudformation-guard/blob/main/action%2FREADME.md

Try mirroring the readme examples.

It's been a minute but iirc the way I designed this you just need to supply GH_TOKEN.

dannyvassallo avatar Oct 11 '25 22:10 dannyvassallo