我需要一些帮助,我在IntelliJ想法中有一个gradle项目,我正在尝试使用github操作来自动化github。github操作的.yml文件包含
name: CI - build and test
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
working-directory: ./project
run: chmod +x ./gradlew
- name: Build
working-directory: ./project
run: ./gradlew build
- name: Test
working-directory: ./project
run: ./gradlew test
- name: Update Website
working-directory: ./project
run: ./gradlew deployReports错误来自于最后一步- name: Update Website working-directory: ./project run: ./gradlew deployReports
下面是位于我的deployReports文件中的build.gradle函数
task deployReports (dependsOn: 'copyWebsite'){
group = "Reporting"
description 'Copies reports to the website repo and pushes to github'
doLast{
def pagesDir = "$buildDir/gh-pages"
exec{
workingDir = 'build/gh-pages'
commandLine = ['git', 'add', '.']
}
exec{
workingDir = 'build/gh-pages'
commandLine = ['git', 'commit', '-m', 'Updating-webpages']
}
exec{
workingDir = 'build/gh-pages'
commandLine = ['git', 'push']
}
}}错误来自这一行commandLine = ['git', 'commit', '-m', 'Updating-webpages']
我不知道如何解决这个问题,因为git是正确安装的,而且我仍然可以提交并将自己推出终端。任何洞察力都会很棒!
发布于 2022-10-25 07:41:10
最简单的解决方案是通过GitHub克隆分支(使用终端)。否则,在这个dir中设置git以便您能够解决这个问题。
这是因为系统在这里找不到任何git命令,并且无法找到git,这就是为什么会发生这样的情况。
https://stackoverflow.com/questions/71713376
复制相似问题