对于我们的应用程序构建号,我们使用分支构建中存储库迄今为止的提交总数。
这是之前使用的实现的
git log --oneline | wc -l
Run Code Online (Sandbox Code Playgroud)
之前我们使用jenkins,现在我们正在更改为github actions。
当尝试使用类似的工作流程步骤来计算提交计数时,每次只给出 1。
我的工作流程。
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ r12.1_githubactions ]
pull_request:
branches: [ r12.1_githubactions ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is …Run Code Online (Sandbox Code Playgroud)