标签: github-actions

Official badge for GitHub actions

Does GitHub have an official 'badge' for their new 'actions' feature?

I came across this request on their official repo and there seems to be an official one:

https://github.com/{github_id}/{repository}/workflows/{workflow_name}/badge.svg
Run Code Online (Sandbox Code Playgroud)

as per this comment, but I am unable to get it to work. Is it actually working? When I use it, I get the below output:

未渲​​染的GitHub徽章

Note that I have replaced {github_id} with my username, {repository} with my repo name and {workflow_name} with the corresponding workflow name (removing the …

github badge github-actions

7
推荐指数
4
解决办法
649
查看次数

如何在github动作中获取当前分支

我正在使用Github Actions构建docker映像,并想用分支名称标记映像,我只找到了GITHUB_REF变量,但结果是refs/heads/feature-branch-1,我只需要feature-branch-1

github github-actions

7
推荐指数
16
解决办法
1306
查看次数

我如何知道我在 github Action 中运行工作流程的总时间?

每次我创建 PR 或提交时,都会运行一些工作流程。但由于我有一个私人存储库,并且每月在 Github Actions 上运行工作流程的时间只有 2000 分钟,所以我想跟踪所用的时间。我如何知道在 Github 提供的 2000 分钟免费时间内我总共使用了多少时间?

Github UI 中是否有一个地方可以看到您已使用的总时间/剩余的总时间?

workflow continuous-integration github github-actions

7
推荐指数
2
解决办法
3986
查看次数

Github Actions:以注释形式报告 dotnet 测试结果

如果使用 Azure Pipelines 运行测试,您将在检查选项卡上获得一些很酷的结果。

在此输入图像描述

有没有什么方法可以从 Github Actions 执行相同的操作,这样我们就不必通过控制台输出?

在此输入图像描述

.net continuous-integration .net-core dotnet-test github-actions

7
推荐指数
1
解决办法
3437
查看次数

如果你使用 GitHub actions 的矩阵策略,那么运行 tox 不是多余的吗?

使用 GitHub actions 矩阵策略,您可以指定您希望代码运行的 python 版本(例如),那么是否需要在 GitHub actions 工作流程中运行 tox?

是否有任何毒素提供了 gh 行动矩阵策略所没有的东西?

谢谢!

tox github-actions

7
推荐指数
1
解决办法
809
查看次数

Github Action:如何保证服务器正常运行?

在我的 GitHub 操作 yaml 文件中,最后有两个命令。第一个用于yarn start(启动服务器),第二个用于运行测试文件。

我通常从本地服务器运行yarn start,然后等到前端和后端端口运行,然后只有我从另一个终端运行测试

但从 GitHub 操作来看,它运行yarn start命令,然后立即运行测试脚本,因此当运行测试文件时,服务器不会侦听端口。这就是我的测试脚本失败的原因。如何确保测试脚本在yarn start完成后运行?

这是我的action.yml文件

name: "Github Actions Test"
on:
  push:
    branches:
      - wip/checkout2

jobs:
  test:
    runs-on: ubuntu-latest

    env:
      PRISMA_ENDPOINT: ${{secrets.PRISMA_ENDPOINT}}
      PRISMA_SECRET: ${{secrets.PRISMA_SECRET}}

    steps:
      - uses: actions/checkout@v1
      - name: "Install Node"
        uses: actions/setup-node@v1
        with:
          node-version: "12.x"
      - name: "Install global packages"
        run: npm install -g yarn prisma-cli concurrently mocha
      - name: "Run docker Container"
        run: docker-compose -f docker-compose.yml up --build -d …
Run Code Online (Sandbox Code Playgroud)

concurrency github github-actions

7
推荐指数
1
解决办法
9951
查看次数

在 Github Actions 工作流程中获取最后提交作者的方法

我正在努力将 Jenkins Pipeline 转换为 Github Actions 工作流程,并且需要一种将提交作者存储为环境变量的方法,以便稍后在 Node.js 代码中使用。

我已阅读文档,这似乎是我可以让它工作的唯一方法:

name: Feature Branch PR

on:
  pull_request:
    types: [opened, edited, synchronize]
  push:
    branches: 
    - '**'
Run Code Online (Sandbox Code Playgroud)

然后在 Env 部分:

env:
   AUTHOR: ${{ github.event.pusher.name }}
Run Code Online (Sandbox Code Playgroud)

问题是这只适用于推送触发器。因此,如果我从 yml 工作流程顶部删除 on: Push 部分(因此它仅在 PR 上触发),那么作者信息将变为空。

我找不到一种方法来获取它的提交。有谁知道有什么办法吗?我们不希望此工作流程在推送时触发。

我也尝试过

        AUTHOR: $(jq '.commits.committer.name' $GITHUB_EVENT_PATH)
Run Code Online (Sandbox Code Playgroud)

我认为这在语法上是不正确的。

github github-actions

7
推荐指数
1
解决办法
8005
查看次数

GitHub 操作 IOS xcode QA/Staging 以及证书和配置文件的问题

我正在使用 xcode 11.3 的 IOS 的 GitHub 操作。我能够构建、导出存档并推送到开发环境的应用程序中心。但是,我在暂存/QA 环境中遇到错误。

如果我提供与暂存/QA 中的开发环境相同的证书和配置文件,我在导出存档时会收到错误(构建成功):-

#Export Archives
##[error]Process completed with exit code 70.
Run xcodebuild -exportArchive -archivePath abc.xcarchive -exportPath abc.ipa -exportOptionsPlist ./abc/ExportOptions.plist          
2020-04-16 15:57:11.154 xcodebuild[7404:37990] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/abcStaging_2020-04-16_15-57-11.153.xcdistributionlogs'.
error: exportArchive: No profiles for 'com.abc.Staging' were found
** EXPORT FAILED **

Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.abc.Staging' were found" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No profiles for 'com.abc.Staging' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS Ad Hoc provisioning profiles matching 'com.abc.Staging'. Automatic …
Run Code Online (Sandbox Code Playgroud)

xcode github ios github-actions

7
推荐指数
1
解决办法
2955
查看次数

如何查看未加密的 git 机密?

背景

我的代码中有一些秘密,在了解 GitHub Actions 后,我决定将它们保存在存储库秘密菜单中,以便以后在我的管道中使用。

问题

但是,现在我需要访问这些秘密来开发新功能,而我不能。每次我尝试查看值时,它都会要求我更新机密。没有选择只是“看到”它们。

我不想更新任何东西,我只想看到它们的值。

如何在项目中查看我的机密的未加密值?

github github-actions

7
推荐指数
6
解决办法
2048
查看次数

如何在 github 操作中使用私有 docker 图像

我正在尝试在运行私有 docker 映像的 github-actions 中设置作业。我将使用容器选项在该 docker 镜像中进行构建。链接

我正在使用以下代码:

jobs:
  container1:
    runs-on: ubuntu-latest
    container: saeed/privateimage:1
    steps:
      - uses: actions/checkout@v2
      - run: |
          echo "Runs inside a container"
Run Code Online (Sandbox Code Playgroud)

但是我无法提供我的 docker hub 凭证,所以它失败了。

如何进行身份验证以提取该私有映像?

谢谢。

docker github-actions

7
推荐指数
3
解决办法
7190
查看次数