标签: github-actions

Github 操作 - node.js CI npm 测试挂起 [Angular9]

github 操作的新手。我已经按照 ghub 文档中关于在工人目录中设置 nodeJs.yml 的教程完成了大部分设置。

遇到这个问题,当它到达npm test的运行命令时,它会生成一条日志,指出它无法打开 chrome 浏览器?它尝试了两次,然后就挂在那里。测试套件位于 jasmine/karma 中。目前,除了创建角度组件时自动生成的测试之外,没有任何单元测试。请参阅随附的 .yml 设置照片和 CI 操作的输出。

如果您能给我提供任何帮助,我将不胜感激,我是管理 github 存储库的新手,似乎无法自己找到任何解决方案。

如果我错过了任何重要细节,请告诉我:)

谢谢你们的宝贵时间!

在此输入图像描述

在此输入图像描述

continuous-integration node.js karma-jasmine angular github-actions

0
推荐指数
1
解决办法
694
查看次数

在 React 中嵌入 GitHub Secret 并部署到 GitHub 页面泄露了我的个人访问令牌

我的目标:我的 React 应用程序有一个环境变量来存储 Github Personal_Access_Token(稍后在 HTTP 标头中用于获取),然后我稍后将使用 Action Workflow 将应用程序部署到 Github 页面。

我尝试过的:鉴于将令牌作为纯文本推送/公开到 Githut 是一种违规行为,我将使用 Github 秘密来避免这种情况。我找到了这篇文章,并尝试实施 Github 工作流程来访问秘密,然后进行部署。

- name: Install and Build 
  run: |
      npm install
      npm run-script build
  env:
      REACT_APP_GITHUB_ACCESS_TOKEN: ${{ secrets.REACT_APP_GITHUB_ACCESS_TOKEN }} // this is what I need


- name: Deploy 
  uses: JamesIves/github-pages-deploy-action@3.5.5
  with:
     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     BRANCH: gh-pages
     FOLDER: build
Run Code Online (Sandbox Code Playgroud)

问题: 工作流程成功运行后,我发现令牌被 GitHub 自动撤销,因为它显示在 中build/static/js/xxxx.chunk.js,并推送到 gh-page 分支:

{headers:{Authorization:"token ac4455aXXXXXXXXXXXXXXXXXXXf80512f3e"}}
Run Code Online (Sandbox Code Playgroud)

这不是我所期望的,但我知道秘密在构建过程中被访问和嵌入,并被放入静态构建文件夹中。

有人可以给我指出方向吗,我在工作流程中做错了什么吗?或者工作流程从来就不是我的问题的解决方案,我不应该使用 GitHub 页面来托管使用秘密令牌的纯 React 应用程序?
提前致谢。

github github-pages reactjs create-react-app github-actions

0
推荐指数
1
解决办法
2731
查看次数

如何在 GitHub 操作中签出子模块?

我有一个带有子模块的存储库,当我推送到某些分支或标签时,我正在创建一个构建。我遇到的问题是我的结帐步骤无法访问我的子模块。设置是:

  1. 两个存储库都在 GitHub 上。
  2. 我是两个存储库的所有者。
  3. 两个存储库都是私有的。
  4. 存储库只能通过 ssh(禁用 https)访问。

我试过使用 GitHub Actionactions/checkout@v2无济于事。如下所示,我尝试使用“ssh-key”选项,其中我已将公钥添加到子模块存储库部署密钥,并将私钥添加到我运行操作的存储库的机密中。我收到以下错误消息:

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin __myrepo__
  ERROR: Repository not found.
  Error: fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  The process '/usr/bin/git' failed with exit code 128
  Waiting 13 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin __myrepo__
  ERROR: Repository …
Run Code Online (Sandbox Code Playgroud)

git github github-actions

0
推荐指数
2
解决办法
1471
查看次数

带有 Fastlane 和 GitHub Actions 的 Android CI/CD:在 master 分支上找不到“fastlane”命令

我正在尝试使用 Github Actions 和 Fastlane 为我的 Android 项目实现 CI/CD 工作流程。我创建了一个工作流程来构建 APK 文件并将其上传到 Firebase App Distribution。当我推送到我的开发分支并按预期将 APK 文件上传到 Firebase App Distribution 时,我的工作流程被触发并成功。

在此输入图像描述

但是相同的工作流程在 master 分支上失败(没有任何代码更改),并出现错误:“bundler:找不到命令:fastlane”

在此输入图像描述

当我在本地设备上调用相同的 fastlane 操作时,它会起作用并将 APK 上传到 Firebase App Distribution。

这是我的车道:

    lane :beta do |options|

        version = options[:versionChange]
        runUnitTests = options[:runUnitTests]
        gitUserMail = options[:gitUserMail]
        gitUserName = options[:gitUserName]

        # 1- Make version code and name incrementation

        if version.nil? || version == 'patch'
            gradle(task: "doPatchVersionIncrement")
        end

        if version == 'major'
            gradle(task: "doMajorVersionIncrement")
        end

        if version == 'minor'
            gradle(task: "doMinorVersionIncrement")
        end …
Run Code Online (Sandbox Code Playgroud)

continuous-integration android continuous-delivery fastlane github-actions

0
推荐指数
1
解决办法
2480
查看次数

获取 https://ghrc.io/v2/: net/http: 等待连接时取消请求(等待标头时超出了 Client.Timeout)

我正在使用 github actions 来构建我的图像并将其推送到 github 注册表。

这是我的部署文件,

name: Build and Push

on:
  push:
    branches:
      - develop

jobs:

 
  build_and_push_to_github_registry:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      - 
        name: Login to Github Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Build and Push
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          target: dev
          tags: ghrc.io/ownerin/customer-service-backend:${{ github.sha }}
Run Code Online (Sandbox Code Playgroud)

这里的所有者是大写字母OwnerIN,但标签不支持大写字母,所以我正在使用ownerin

但是当作业运行时,我收到以下错误。构建成功,push 步骤发生错误。

...
pushing ghrc.io/ownerin/customer-service-backend:0679931b537b724ca21e6ef53178d4bf0725b4b5 with docker:
error: Get https://ghrc.io/v2/: net/http: request …
Run Code Online (Sandbox Code Playgroud)

continuous-integration github docker devops github-actions

0
推荐指数
1
解决办法
1877
查看次数

如何使用 React 应用程序的 Github Actions 将徽章添加到 .readme

假设我有一个基本的 github 操作来构建我的应用程序,然后将其部署到 firebase:

name: Firebase Deploy
on:
  push:
    branches:
      - master
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2.3.2
      - name: Install Dependencies
        run: npm install
      - name: Run Tests
        env:
          CI: true
        run: npm test
      - name: Build
        run: npm run build
      - name: Archive Production Artifact
        uses: actions/upload-artifact@v2
        with:
          name: build
          path: build
  deploy:
    name: Deploy
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2.3.2
      - name: Download Artifact
        uses: …
Run Code Online (Sandbox Code Playgroud)

github-actions

0
推荐指数
1
解决办法
1304
查看次数

GitHub maven CI error Missing commit <commit hash>

I am trying to set up the standard maven CI pipeline (so just mvn package) on GitHub, but I always get the error "Error: Missing commit ", where is referencing the second last commit (so not the commit that this run is checking, but the commit before).

I already reset the whole build pipeline by deleting it and setting it up freshly again, but that didn't help.

The maven.yml is the standard maven.yml created by GitHub, but here it is: …

github maven github-actions

0
推荐指数
1
解决办法
383
查看次数

先前作业 GH 操作的参考输出

我正在尝试使用 GitHub Actions 来构建完整的管道,包括自动 SemVer 版本控制(使用标签),然后我希望在构建 Docker 映像后使用它来使用当前版本对其进行标记。这是我用来提升版本的操作,它应该有一个 new_tag 输出,但我无法引用它,这就是我正在尝试的:

jobs:
  setup:
    ...
  version:
    needs: [setup]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: '0'
    - name: Bump version and push tag
      uses: anothrNick/github-tag-action@1.26.0
      id: autoversion
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        WITH_V: true
  sonar:
    ...
  anchore:
    ...
  docker:
    needs: [setup, version]
    steps:
      ...
      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          tags: ansfire/flaskql:${{ needs.version.autoversion.outputs.new_tag }}
Run Code Online (Sandbox Code Playgroud)

根据我所读到的内容,使用needs密钥应该允许一个作业访问上游作业,但我无法让它访问它。outputs我在舞台上需要钥匙吗version?谢谢!

github-actions github-actions-artifacts

0
推荐指数
1
解决办法
1685
查看次数

Android 与 github 操作某些许可证尚未被接受

我设置了以下 github 工作流程来构建 aab

name: upload-aab-to-play-console
on:
  push:
    branches:
      - main-kt-prod
jobs:
  build:
    runs-on: ubuntu-latest
    env:
      SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: set up JDK 1.8
        id: Setup_JDK
        uses: actions/setup-java@v1
        with:
          java-version: 11
  - name: build-with-gradle
    id: build
    run: |
      chmod +x gradlew
      ./gradlew build
Run Code Online (Sandbox Code Playgroud)

但我收到以下错误

FAILURE: Build failed with an exception.
Warning: License for package Android SDK Build-Tools 32-rc1 not accepted.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'. …
Run Code Online (Sandbox Code Playgroud)

android android-gradle-plugin github-actions

0
推荐指数
1
解决办法
1032
查看次数

如何向 nuget 包添加标签?

我目前正在使用 github 操作(特别是使用 Brandedoutcast/publish-nuget@v2.5.5 操作)将包部署到 Nuget。包已成功推送,但如何将项目标签和社交媒体链接添加到 Nuget 上的项目中:

标签示例

我正在使用 JetBrains Rider 来开发相关项目,因此我对如何编辑包保留有点困惑。

c# deployment github nuget github-actions

0
推荐指数
1
解决办法
810
查看次数