AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / coding / 问题

问题[github](coding)

Martin Hope
Claudiu
Asked: 2025-04-04 02:25:33 +0800 CST

Github markdown:花括号中的数字代表什么意思?

  • 6

(github) markdown 中代码类型后面花括号里的数字代表什么意思?找不到相关文档

    ```js{6, 15}
    export default {
      setup() {
        const input = ref(null)
        // ...
        return {
          input
        }
      }
    }
    ```

在多个前端框架的文档中找到了它

github
  • 1 个回答
  • 23 Views
Martin Hope
redoc01
Asked: 2024-12-24 12:07:07 +0800 CST

尝试推送 git 文件,但出现此错误“致命:无效的代理 URL‘https:/github.com’:仅 SOCKS 代理支持路径”

  • 6

我尝试了这个命令:

git push -u origin main

但我收到此错误:

fatal: Invalid proxy URL 'https:/github.com': only SOCKS proxies support paths
fatal: remote helper 'https' aborted session

我该如何修复它

github
  • 1 个回答
  • 10 Views
Martin Hope
Floren
Asked: 2024-12-24 05:10:06 +0800 CST

无法使用 createCommitOnBranch 创建的已验证提交来更新 PR

  • 5

我的目标是使用 GitHub 的 Graphql API 生成经过验证的提交。我创建了一个测试存储库来验证经过验证的 PR 创建,并且我看到 GitHub Action 生成了新README.md文件。但是,它并未添加到existing PR (link removed, see provided answer)正在进行中。

当 GitHub Action 运行时,我收到以下错误:

Switched to a new branch 'feature/verified-commit'
branch 'feature/verified-commit' set up to track 'origin/feature/verified-commit'.
time="2024-12-23T23:30:48Z" level=info msg="Found Chart directories [roles/argo-cd]"
time="2024-12-23T23:30:48Z" level=info msg="Generating README Documentation for chart roles/argo-cd"
-rw-r--r-- 1 runner docker 409 Dec 23 23:30 .github/api/commit.gql
error parsing " 'query" value: open .github/api/commit.gql': no such file or directory

谢谢你让我知道我所想念的。

github
  • 2 个回答
  • 38 Views
Martin Hope
swagrov
Asked: 2024-12-14 03:13:05 +0800 CST

github api(gh api)工作流运行端点无法使用查询参数

  • 5

当我运行这个命令时,我得到了结果gh api repos/myorg/myrepo/actions/workflows/my-workflow.yaml/runs。我希望只从主分支抓取运行结果,而不是事后进行过滤。根据文档,“当使用以下参数时,此端点将为每次搜索返回最多 1,000 个结果:actor、branch、check_suite_id、created、event、head_sha、status。”

但是,如果我添加-f 'branch=master',,或-F 'branch=master',只会得到 404:-f branch=master-F branch=master

gh: Not Found (HTTP 404)
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest",
  "status": "404"
}

分支名称正确。参数有什么问题?包括标头也不起作用,并给出 404:

gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  repos/myorg/myrepo/actions/workflows/my-workflow.yaml/runs -f "branch=master"

(我在这里用泛型替换了组织、存储库和工作流名称。)

github
  • 1 个回答
  • 15 Views
Martin Hope
granadaCoder
Asked: 2024-12-02 19:27:04 +0800 CST

存档命令 github“history”

  • 5

以下是关于如何存档仓库的链接

https://docs.github.com/en/repositories/archiving-a-github-repository/archiving-repositories

我的问题不是“如何”

我正在尝试弄清楚如何查看历史记录(又名“谁”(或哪个服务帐户)执行了存档)。

这个正常的 repo 历史记录向我显示了“文件更改”。

但是没有(或者我没有足够的权限查看)ARCHIVE 操作的历史记录。

我可以在哪里看到此类行动的历史记录?

......

附加:

当我查看 repo“活动”时。

/我的仓库名称/活动

活动‘类型’的下拉菜单包括:

"All activity"
"Direct pushes"
"Pull request merges"
"Merge queue merges"
"Force pushes"
"Branch creations"
"Branch deletions"

并且没有“红区”类型。

github
  • 1 个回答
  • 25 Views
Martin Hope
BobDidley
Asked: 2024-11-22 04:23:46 +0800 CST

变异响应数据是否算作 GitHub GraphQL API 中的查询点?

  • 6

我正在尝试了解 GitHub 的 GraphQL API,我想知道突变请求的响应是否计入GitHub 的速率限制?根据二级速率限制,突变请求计为 5 分,非突变请求(查询请求?)计为 1 分。GraphQL 请求分配 2000 分。我想知道,例如,以下请求是计为 5 分还是 6 分。

mutation addIssue($input: CreateIssueInput!) {
  createIssue(input: $input) {
    issue {
      id
    }
  }
}

我对 GraphQL 还很陌生,欢迎任何反馈。

github
  • 1 个回答
  • 20 Views
Martin Hope
pegasus
Asked: 2024-11-05 08:59:52 +0800 CST

如何将文件上传到“github.com/<owner>/<repo>/files/<number>/<file_name>”?

  • 6

我不知道该文件(https://github.com/Flexget/Flexget/files/13787215/pendulum-3.0.0-py3-none-any.whl.zip)是如何上传的,我看到有人在这里上传了该文件。

我只知道如何将文件上传到存储库,但我不知道如何将文件上传到github.com/<owner>/<repo>/files/<number>/<file_name>。

GitHub 上是否有可以上传文件的页面github.com/<owner>/<repo>/files/<number>/<file_name>?

github
  • 1 个回答
  • 23 Views
Martin Hope
jean553
Asked: 2024-11-02 00:51:28 +0800 CST

Github REST API - 检索“对话”部分下的 Pull 请求评论

  • 6

我想通过 Github API 检索“对话”选项卡下的 Pull 请求中添加的评论。

我已经可以检索直接插入到“文件更改”选项卡下的代码中的那些,但是(通过GET .../pulls/{pullRequestId}/comments),但是,我无法检索在“对话”部分中添加的那些。我尝试过GET .../issues/{pullRequestId}/comments,GET .../pulls)

github
  • 1 个回答
  • 15 Views
Martin Hope
David Keaveny
Asked: 2024-10-23 08:45:57 +0800 CST

从 Azure Devops 管道使用托管在 GitHub 上的私有 NuGet 提要

  • 5

我在 GitHub 上托管了一个仓库,用于构建 NuGet 包并将其发布到 NuGet 托管的私有源。如果我使用 GitHub Actions 创建工作流,那么我就可以毫无问题地使用 NuGet 包。

我遇到的问题是,我试图从 Azure DevOps 实例中运行的管道使用该 NuGet 包。我在 Azure DevOps 中创建了一个名为的 NuGet 服务连接github-nuget,并在我的工作流程中引用它,如下所示:

trigger: none

resources:
- repo: self

stages:
- stage: Packaging
  jobs:
  - job: buildAndPackage
    steps:
    - task: NuGetAuthenticate@1
      inputs:
        nuGetServiceConnections: 'github-nuget'
    - script: >-
        docker build
        --build-arg NUGET_GITHUBUSER=doesnt-really-matter
        --build-arg NUGET_GITHUBTOKEN=$(VSS_NUGET_ACCESSTOKEN)
        --tag my-api:$(Build.BuildNumber)
        --file api/src/MyProject.Web/Dockerfile .

然后在我的 Dockerfile 中,我的构建阶段如下:

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG NUGET_GITHUBUSER
ARG NUGET_GITHUBTOKEN
ENV NUGET_GITHUBUSER=${NUGET_GITHUBUSER}
ENV NUGET_GITHUBTOKEN=${NUGET_GITHUBTOKEN}
WORKDIR /src
COPY ["api/src/MyProject.Web/MyProject.Web.csproj", "api/src/MyProject.Web/"]
COPY ["nuget.config", "/"]
RUN dotnet nuget update source github --username ${NUGET_GITHUBUSER} --password ${NUGET_GITHUBTOKEN} --store-password-in-clear-text --valid-authentication-types basic
RUN dotnet restore "api/src/MyProject.Web/MyProject.Web.csproj"
COPY . .
WORKDIR "/src/api/src/MyProject.Web"
RUN dotnet build "MyProject.Web.csproj" -c Release -o /app/build --no-restore

当尝试从私有 feed 中检索 NuGet 包时,构建失败:

#43 [build 34/38] RUN dotnet nuget update source github --username anyone --password *** --store-password-in-clear-text --valid-authentication-types basic
#43 0.492 Package source "github" was successfully updated.
#43 DONE 0.7s

#44 [build 35/38] RUN dotnet restore "api/src/MyProject.Web/MyProject.Web.csproj"
#44 1.332   Determining projects to restore...
#44 4.554 /usr/share/dotnet/sdk/8.0.403/NuGet.targets(174,5): warning : Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured. [/src/api/src/MyProject.Web/MyProject.Web.csproj]
#44 4.571   Retrying 'FindPackagesByIdAsync' for source 'https://nuget.pkg.github.com/my-org/download/my.shared.package/index.json'.
#44 4.571   Response status code does not indicate success: 401 (Unauthorized).

有什么想法吗?在我看来,该NuGetAuthenticate步骤没有正确设置 GitHub 所需的个人访问令牌,但由于它是一个密码,因此无法在日志中验证实际发送的内容。执行NuGetAuthenticate似乎是成功的:

Installing the Azure Artifacts Credential Provider (.NET Core) to '/home/vsts/.nuget/plugins/netcore/CredentialProvider.Microsoft'. This credential provider is compatible with .NET SDK 6 or later.

Setting up the credential provider to use the identity 'MyProject.API Build Service (my-org)' for feeds in your organization/collection starting with:
  https://pkgs.dev.azure.com/my-org/
  https://my-org.pkgs.visualstudio.com/

Setting up the credential provider for these service connections:
  https://nuget.pkg.github.com/my-org/index.json

Finishing: Authenticate private NuGet feed
github
  • 1 个回答
  • 44 Views
Martin Hope
KamilCuk
Asked: 2024-10-20 20:51:12 +0800 CST

如何将存储库设置为需要 API 中所有外部合作者的批准?

  • 5

我想要设置或检查以下设置:

在此处输入图片描述

使用 github API。我尝试搜索https://docs.github.com/en/rest/repos?apiVersion=2022-11-28、https://docs.github.com/en/graphql、https://docs.github.com/en/graphql/reference/mutations和谷歌,但找不到与设置相关的任何内容。我该怎么做?

我甚至乐意列出列表中哪些存储库没有设置此设置,以便我可以手动逐个更新它们。

github
  • 1 个回答
  • 15 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve