chainguard-dev / actions

A collection of reusable Github Actions workflows.
Apache License 2.0
119 stars 57 forks source link

Adding this action causes errors #468

Closed cjhelloletsgo closed 3 months ago

cjhelloletsgo commented 3 months ago

I am attempting to add this to my github actions. The action works perfectly but if I add the requisite

permissions:
  id-token: write

I immediately start getting errors that my repository doesn't exist (It 100% does because it works fine without the added permission). Without the permission I get an OIDC error so I know it is required. Adding it makes my action not run though.

Here is the error message with redacted repo name:

Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +733056d0a9a55cbb7f249a9a52b507e3151960e4:refs/remotes/origin/master
  remote: Repository not found.
  Error: fatal: repository 'VALID_REPOSITORY_HERE' not found
name: Ruff Linting

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  lint:
    # permissions:
    #   id-token: write # Enable OIDC

    runs-on: ubuntu-latest
    permissions:
      id-token: write

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: "3.12"

      - name: Install ruff
        run: pip install ruff

      - name: Run ruff
        run: ruff check . --ignore F841 --fix

      - name: Format code
        run: ruff format

      - uses: chainguard-dev/actions/setup-gitsign@main

      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "style fixes by ruff"
          commit_options: