Skip to content

gh repo sync fails with surprising error if workflow scope is missing and token is from GitHub App #10573

Description

@williammartin

Describe the bug

This is an extension of #7574 based on the comment that the previous fix doesn't work for GitHub App tokens.

Affected version

v2.68.1

Acceptance Criteria

Given I have a GitHub App token that is missing workflow scope
When I run gh repo sync where the upstream repo has workflow changes to be synced
Then I get an informative error rather than a 404.

Activity

  1. added
    bugSomething isn't working
    priority-3Affects a small number of users or is largely cosmetic
    gh-reporelating to the gh repo command
    on Mar 10, 2025
  2. wata727 commented on Mar 10, 2025

    @wata727
    Contributor

    Thank you for opening the issue.

    The easiest way to reproduce this is to run gh repo sync <remote> using the token issued by GitHub Actions. Please also refer to terraform-linters/magic-modules#7.

    The build log is as follows:
    https://github.com/terraform-linters/magic-modules/actions/runs/13742985933/job/38434464702

    The build log with GH_DEBUG=api is as follows:
    https://github.com/terraform-linters/magic-modules/actions/runs/13745172118/job/38439197950

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

    bugSomething isn't workinggh-reporelating to the gh repo commandpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions