Skip to content

Compliance: missing-ci.yml #46

Closed

Description

@don-petry

Compliance Finding

Category: ci-workflows
Severity: error
Check: missing-ci.yml

Detail

Required workflow ci.yml is missing

Standard Reference

standards/ci-standards.md#required-workflows

Remediation

Please review the linked standard and bring this repository into compliance.

See the full standards documentation for implementation guidance.


This issue was automatically created by the weekly compliance audit.

Activity

  1. claude commented on Apr 5, 2026

    @claude

    Claude Code is working…

    I'll analyze this and get back to you.

    View job run

  2. don-petry commented on Apr 6, 2026

    @don-petry
    ContributorAuthor

    Weekly Compliance Audit (2026-04-06)

    This finding is still open.

    Detail: Required workflow ci.yml is missing

    Standard: standards/ci-standards.md#required-workflows

  3. don-petry commented on Apr 6, 2026

    @don-petry
    ContributorAuthor

    Weekly Compliance Audit (2026-04-06)

    This finding is still open.

    Detail: Required workflow ci.yml is missing

    Standard: standards/ci-standards.md#required-workflows

  4. don-petry commented on Apr 6, 2026

    @don-petry
    ContributorAuthor

    Weekly Compliance Audit (2026-04-06)

    This finding is still open.

    Detail: Required workflow ci.yml is missing

    Standard: standards/ci-standards.md#required-workflows

  5. don-petry commented on Apr 6, 2026

    @don-petry
    ContributorAuthor

    Weekly Compliance Audit (2026-04-06)

    This finding is still open.

    Detail: Required workflow ci.yml is missing

    Standard: standards/ci-standards.md#required-workflows

  6. don-petry commented on Apr 6, 2026

    @don-petry
    ContributorAuthor

    Weekly Compliance Audit (2026-04-06)

    This finding is still open.

    Detail: Required workflow ci.yml is missing

    Standard: standards/ci-standards.md#required-workflows

  7. don-petry commented on Apr 6, 2026

    @don-petry
    ContributorAuthor

    Claude finished @don-petry's task in 4m 33s —— View job


    Issue #46: Missing ci.yml — Blocked by workflow permissions

    • Gather context: read standards and existing workflows
    • Understand what ci.yml should contain (coding-standards.md §7)
    • Create ci.yml workflow
    • Push to remote — blocked (see below)

    What happened

    I wrote the ci.yml and committed it locally, but the push was rejected:

    refusing to allow a GitHub App to create or update workflow
    `.github/workflows/ci.yml` without `workflows` permission
    

    GitHub requires the workflows write permission to create or modify files under .github/workflows/. The Claude Code GitHub App token currently only has contents: write, which is insufficient for workflow files.

    Fix: add workflows: write to .github/workflows/claude.yml

    A repo admin needs to update .github/workflows/claude.yml to add the workflows permission:

    permissions:
      contents: write
      id-token: write
      pull-requests: write
      issues: write
      actions: read
      checks: read
      workflows: write   # ← add this line

    Once that change is merged to main, re-trigger this issue (e.g. remove and re-add the claude label) and I'll push the workflow file automatically.

    The ci.yml I wrote

    Here is the complete file, ready to be saved as .github/workflows/ci.yml:

    View ci.yml
    # CI — lint, test, build for Go backend and React Native/Expo frontend.
    #
    # Gates per coding-standards.md §7:
    #   Backend:  golangci-lint, go test (short + coverage ≥80%), go build, gqlgen validate
    #   Frontend: tsc --noEmit, eslint, prettier, jest --ci --coverage (≥80%)
    #
    # Ecosystem detection mirrors dependency-audit.yml so jobs are skipped when
    # the corresponding source tree does not yet exist.
    name: CI
    
    on:
      push:
        branches: [main]
      pull_request:
        branches: [main]
    
    permissions: {}
    
    jobs:
      # ── Detect which source trees are present ──────────────────────────────────
      detect:
        name: Detect ecosystems
        runs-on: ubuntu-latest
        outputs:
          go: ${{ steps.check.outputs.go }}
          node: ${{ steps.check.outputs.node }}
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - name: Detect ecosystems
            id: check
            run: |
              if find . -name 'go.mod' -not -path '*/vendor/*' | grep -q .; then
                echo "go=true"  >> "$GITHUB_OUTPUT"
              else
                echo "go=false" >> "$GITHUB_OUTPUT"
              fi
    
              if find . -name 'package.json' -not -path '*/node_modules/*' | grep -q .; then
                echo "node=true"  >> "$GITHUB_OUTPUT"
              else
                echo "node=false" >> "$GITHUB_OUTPUT"
              fi
    
      # ── Go backend ─────────────────────────────────────────────────────────────
      backend:
        name: Backend CI
        needs: detect
        if: needs.detect.outputs.go == 'true'
        runs-on: ubuntu-latest
        permissions:
          contents: read
    
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
            with:
              go-version-file: go.mod
              cache: true
    
          - name: Lint
            uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
            with:
              version: v2.1.6
    
          - name: Build
            run: go build ./cmd/api/
    
          - name: Validate GraphQL schema
            run: go run github.com/99designs/gqlgen validate
    
          - name: Unit tests + coverage
            run: go test ./... -short -count=1 -coverprofile=coverage.out
    
          - name: Enforce 80% line coverage
            run: |
              pct=$(go tool cover -func=coverage.out \
                      | awk '/^total:/ { gsub(/%/, "", $NF); print $NF }')
              echo "Coverage: ${pct}%"
              awk -v p="$pct" 'BEGIN { if (p+0 < 80) { print "Coverage "p"% is below required 80%"; exit 1 } }'
    
      # ── React Native / Expo frontend ───────────────────────────────────────────
      frontend:
        name: Frontend CI
        needs: detect
        if: needs.detect.outputs.node == 'true'
        runs-on: ubuntu-latest
        permissions:
          contents: read
    
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
            with:
              node-version: lts/*
              cache: npm
    
          - name: Install dependencies
            run: npm ci
    
          - name: Type check
            run: npx tsc --noEmit
    
          - name: Lint
            run: npx eslint . --max-warnings 0
    
          - name: Format check
            run: npx prettier --check .
    
          - name: GraphQL codegen check
            run: npx graphql-codegen --check
    
          - name: Test + coverage
            run: npx jest --ci --coverage --coverageThreshold='{"global":{"lines":80,"branches":80}}'

    Alternatively, you can manually create the file (copy the content above) and open a PR directly.

  8. don-petry commented on Apr 7, 2026

    @don-petry
    ContributorAuthor

    Claude finished @don-petry's task in 2m 10s —— View job


    Issue #46: Missing ci.yml — Blocked by workflow permissions (again)

    • Gather context and read standards (coding-standards.md §7)
    • Check current repo state and existing workflows
    • Create ci.yml with all required CI gates
    • Committed locally — push rejected (no workflows: write permission)

    What happened

    I wrote and committed the ci.yml, but the push was rejected again:

    refusing to allow a GitHub App to create or update workflow
    `.github/workflows/ci.yml` without `workflows` permission
    

    The claude.yml workflow still only grants contents: write. GitHub requires workflows: write to create or modify files under .github/workflows/.

    Fix required (repo admin)

    Add workflows: write to .github/workflows/claude.yml:

    permissions:
      contents: write
      id-token: write
      pull-requests: write
      issues: write
      actions: read
      checks: read
      workflows: write   # ← add this line

    Once merged to main, re-trigger by removing and re-adding the claude label and I'll push automatically.

    Alternative: create the file manually

    Copy the content below, save it as .github/workflows/ci.yml, and open a PR.

    View ci.yml
    # CI — lint, test, build for Go backend and React Native/Expo frontend.
    #
    # Gates per coding-standards.md §7:
    #   Backend:  golangci-lint, go test (short + integration), coverage ≥80% line,
    #             go build ./cmd/api/, gqlgen validate
    #   Frontend: tsc --noEmit, eslint, prettier --check, jest --ci --coverage ≥80%,
    #             graphql-codegen --check
    #
    # Ecosystem detection mirrors dependency-audit.yml so jobs are skipped when
    # the corresponding source tree does not yet exist.
    name: CI
    
    on:
      push:
        branches: [main]
      pull_request:
        branches: [main]
    
    permissions: {}
    
    jobs:
      # ── Detect which source trees are present ──────────────────────────────────
      detect:
        name: Detect ecosystems
        runs-on: ubuntu-latest
        outputs:
          go: ${{ steps.check.outputs.go }}
          node: ${{ steps.check.outputs.node }}
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - name: Detect ecosystems
            id: check
            run: |
              if find . -name 'go.mod' -not -path '*/vendor/*' | grep -q .; then
                echo "go=true"  >> "$GITHUB_OUTPUT"
              else
                echo "go=false" >> "$GITHUB_OUTPUT"
              fi
    
              if find . -name 'package.json' -not -path '*/node_modules/*' | grep -q .; then
                echo "node=true"  >> "$GITHUB_OUTPUT"
              else
                echo "node=false" >> "$GITHUB_OUTPUT"
              fi
    
      # ── Go backend ─────────────────────────────────────────────────────────────
      backend:
        name: Backend CI
        needs: detect
        if: needs.detect.outputs.go == 'true'
        runs-on: ubuntu-latest
        permissions:
          contents: read
    
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
            with:
              go-version-file: go.mod
              cache: true
    
          - name: Lint
            uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
            with:
              version: v2.1.6
    
          - name: Build
            run: go build ./cmd/api/
    
          - name: Validate GraphQL schema
            run: go run github.com/99designs/gqlgen validate
    
          - name: Unit tests
            run: go test ./... -short -count=1
    
          - name: Integration tests
            run: go test -tags=integration ./... -count=1
    
          - name: Coverage check (≥80% line)
            run: |
              go test ./... -short -count=1 -coverprofile=coverage.out
              pct=$(go tool cover -func=coverage.out \
                      | awk '/^total:/ { gsub(/%/, "", $NF); print $NF }')
              echo "Coverage: ${pct}%"
              awk -v p="$pct" 'BEGIN {
                if (p+0 < 80) { print "Coverage " p "% is below required 80%"; exit 1 }
              }'
    
      # ── React Native / Expo frontend ───────────────────────────────────────────
      frontend:
        name: Frontend CI
        needs: detect
        if: needs.detect.outputs.node == 'true'
        runs-on: ubuntu-latest
        permissions:
          contents: read
    
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
            with:
              node-version: lts/*
              cache: npm
    
          - name: Install dependencies
            run: npm ci
    
          - name: Type check
            run: npx tsc --noEmit
    
          - name: Lint
            run: npx eslint . --max-warnings 0
    
          - name: Format check
            run: npx prettier --check .
    
          - name: GraphQL codegen check
            run: npx graphql-codegen --check
    
          - name: Test + coverage (≥80% branch and line)
            run: npx jest --ci --coverage --coverageThreshold='{"global":{"lines":80,"branches":80}}'

    Improvements vs. previous attempt

    This version adds the integration tests gate (go test -tags=integration ./...) which was missing from the previous draft but is required by coding-standards.md §7.

    @don-petry — as the code owner, please either add workflows: write to claude.yml and re-trigger, or manually create the file above.

  9. don-petry commented on Apr 7, 2026

    @don-petry
    ContributorAuthor

    Claude finished @don-petry's task in 1m 14s —— View job


    Issue #46: Missing ci.yml — Blocked by GitHub App Permissions

    • Analyze issue and previous attempts
    • Check current branch state and CODEOWNERS
    • Determine path forward

    Status: Human action required

    I've confirmed the same blocker as the previous two runs. Creating or modifying files under .github/workflows/ is outside my capabilities — GitHub's API rejects pushes of workflow files from an App token that lacks workflows: write, and this is a documented limitation of the Claude Code GitHub App.

    The current claude.yml grants only:

    permissions:
      contents: write
      id-token: write
      pull-requests: write
      issues: write
      actions: read
      checks: read
      # workflows: write  ← missing

    Two options to resolve this

    Option A — Grant workflows: write (then re-trigger)

    A repo admin needs to add workflows: write to .github/workflows/claude.yml:

    permissions:
      contents: write
      id-token: write
      pull-requests: write
      issues: write
      actions: read
      checks: read
      workflows: write   # ← add this line

    After merging to main, remove and re-add the claude label on this issue and I'll push the file automatically.

    Option B — Create the file manually

    Copy the content below, save it as .github/workflows/ci.yml, open a PR, and close this issue.

    View ci.yml (ready to use)
    # CI — lint, test, build for Go backend and React Native/Expo frontend.
    #
    # Gates per coding-standards.md §7:
    #   Backend:  golangci-lint, go test (short + integration), coverage ≥80% line,
    #             go build ./cmd/api/, gqlgen validate
    #   Frontend: tsc --noEmit, eslint, prettier --check, jest --ci --coverage ≥80%,
    #             graphql-codegen --check
    #
    # Ecosystem detection mirrors dependency-audit.yml so jobs are skipped when
    # the corresponding source tree does not yet exist.
    name: CI
    
    on:
      push:
        branches: [main]
      pull_request:
        branches: [main]
    
    permissions: {}
    
    jobs:
      # ── Detect which source trees are present ──────────────────────────────────
      detect:
        name: Detect ecosystems
        runs-on: ubuntu-latest
        outputs:
          go: ${{ steps.check.outputs.go }}
          node: ${{ steps.check.outputs.node }}
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - name: Detect ecosystems
            id: check
            run: |
              if find . -name 'go.mod' -not -path '*/vendor/*' | grep -q .; then
                echo "go=true"  >> "$GITHUB_OUTPUT"
              else
                echo "go=false" >> "$GITHUB_OUTPUT"
              fi
    
              if find . -name 'package.json' -not -path '*/node_modules/*' | grep -q .; then
                echo "node=true"  >> "$GITHUB_OUTPUT"
              else
                echo "node=false" >> "$GITHUB_OUTPUT"
              fi
    
      # ── Go backend ─────────────────────────────────────────────────────────────
      backend:
        name: Backend CI
        needs: detect
        if: needs.detect.outputs.go == 'true'
        runs-on: ubuntu-latest
        permissions:
          contents: read
    
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
            with:
              go-version-file: go.mod
              cache: true
    
          - name: Lint
            uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
            with:
              version: v2.1.6
    
          - name: Build
            run: go build ./cmd/api/
    
          - name: Validate GraphQL schema
            run: go run github.com/99designs/gqlgen validate
    
          - name: Unit tests
            run: go test ./... -short -count=1
    
          - name: Integration tests
            run: go test -tags=integration ./... -count=1
    
          - name: Coverage check (≥80% line)
            run: |
              go test ./... -short -count=1 -coverprofile=coverage.out
              pct=$(go tool cover -func=coverage.out \
                      | awk '/^total:/ { gsub(/%/, "", $NF); print $NF }')
              echo "Coverage: ${pct}%"
              awk -v p="$pct" 'BEGIN {
                if (p+0 < 80) { print "Coverage " p "% is below required 80%"; exit 1 }
              }'
    
      # ── React Native / Expo frontend ───────────────────────────────────────────
      frontend:
        name: Frontend CI
        needs: detect
        if: needs.detect.outputs.node == 'true'
        runs-on: ubuntu-latest
        permissions:
          contents: read
    
        steps:
          - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
    
          - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
            with:
              node-version: lts/*
              cache: npm
    
          - name: Install dependencies
            run: npm ci
    
          - name: Type check
            run: npx tsc --noEmit
    
          - name: Lint
            run: npx eslint . --max-warnings 0
    
          - name: Format check
            run: npx prettier --check .
    
          - name: GraphQL codegen check
            run: npx graphql-codegen --check
    
          - name: Test + coverage (≥80% branch and line)
            run: npx jest --ci --coverage --coverageThreshold='{"global":{"lines":80,"branches":80}}'

    @don-petry — as the CODEOWNER for this repository, please choose one of the options above to unblock this. More info on the permissions limitation: Claude Code FAQ.

  10. don-petry commented on Apr 7, 2026

    @don-petry
    ContributorAuthor

    @claude Please retry this issue from scratch — the previous "blocked by workflows permission" comments are stale.

    Context that has changed since prior attempts:

    • petry-projects/.github PR ci: add required ci.yml workflow (closes #46) #82 was merged at 2026-04-07 17:22 UTC. It added token: ${{ secrets.GH_PAT_WORKFLOWS || github.token }} to the actions/checkout step in claude-code-reusable.yml, so git push now uses the workflow-scoped PAT instead of the default GITHUB_TOKEN.
    • The fix was validated end-to-end on petry-projects/google-app-scripts#122 — Claude successfully pushed .github/workflows/agent-shield.yml and opened PR Compliance: unpinned-actions-auto-rebase.yml #146 (now merged).
    • The PAT secret GH_PAT_WORKFLOWS is configured at the org level with visibility = all repositories, last updated 2026-04-07 12:00 UTC.

    Do not skip the push attempt based on prior comment history. Implement the fix, commit, push, and open a PR. If the push fails for any new reason, report the actual error message rather than referring back to the historical blocker.

  11. don-petry commented on Apr 7, 2026

    @don-petry
    ContributorAuthor

    Claude finished @don-petry's task in 1m 29s —— View job • claude/issue-46-20260407-1744 • [Create PR ➔](https://github.com/petry-projects/markets/compare/main...claude/issue-46-20260407-1744?quick_pull=1&title=Issue%20%2346%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%2346%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Issue #46: Adding ci.yml

    • Gather context: read standards and existing workflows
    • Create ci.yml workflow
    • Commit and push
    • Open PR — #75
    • Self-review PR — fixed missing permissions: contents: read on detect job
    • Tag code owners

    Summary

    PR #75 adds .github/workflows/ci.yml with:

    • detect job — auto-detects Go and Node ecosystems (skips jobs when source trees are absent)
    • backend job — golangci-lint, go build ./cmd/api/, gqlgen validate, unit tests, integration tests, ≥80% line coverage
    • frontend job — tsc, eslint, prettier, graphql-codegen check, jest ≥80% branch+line coverage

    Self-review fix pushed: the detect job was missing permissions: contents: read (needed for actions/checkout), which would have caused it to fail under the workflow-level permissions: {} lock.

    @don-petry — please review and merge when ready.
    | PR #75

  12. added a commit that references this issue on Apr 7, 2026
    e31f040
  13. don-petry commented on Apr 8, 2026

    @don-petry
    ContributorAuthor

    Claude finished @don-petry's task in 2m 49s —— View job • claude/issue-46-20260408-2243 • [Create PR ➔](https://github.com/petry-projects/markets/compare/main...claude/issue-46-20260408-2243?quick_pull=1&title=Issue%20%2346%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%2346%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)


    Issue #46: Adding ci.yml

    • Gather context: checked existing workflows, fetched CI standards
    • Confirmed ci.yml is Tier 2 (per-repo template, no copy-verbatim template exists)
    • Looked up action SHAs via gh api (never guessed)
    • Created ci.yml with proper SHA pinning, concurrency block, ecosystem detection
    • Committed and pushed
    • Opened PR — #82
    • Self-review PR — no issues found
    • Tagged CODEOWNERS (@don-petry)

    Summary

    PR #82 adds .github/workflows/ci.yml with:

    • detect job — auto-detects Go and Node ecosystems, skips downstream jobs when source trees are absent (graceful on a pre-code repo)
    • backend job — golangci-lint v6, go build ./cmd/api/, gqlgen validate, unit tests, integration tests, ≥80% line coverage
    • frontend job — tsc, eslint, prettier, graphql-codegen check, jest ≥80% branch+line coverage
    • permissions: {} at top level with contents: read per job
    • concurrency: group: ci-${{ github.ref }}, cancel-in-progress: true
    • All actions SHA-pinned (looked up via gh api)
      | Branch
  14. added 2 commits that reference this issue on Apr 8, 2026
    f7a4368
    51242cd
  15. added a commit that references this issue on Jun 19, 2026
    ab3f15f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compliance-auditAutomated compliance audit finding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions