【问题标题】:Unable to run a gradle github workflow无法运行 gradle github 工作流
【发布时间】:2022-06-17 09:19:59
【问题描述】:

我正在尝试为我的项目设置工作流程。我使用标准的“使用 gradle 配置”工作流程,只是将 java 版本从 11 编辑到 17。

但是当我推送我的代码时,它会抛出一个错误:

这是我目前的工作流程

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

permissions:
  contents: read

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3        
    - name: Setup jdk-17
      uses: actions/setup-java@main
      with:
        java-version: 17
        distribution: 'adopt'
    - name: Build with Gradle
      uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
      with:
        arguments: ./gradlew build

  Gradle User Home cache not found. Will initialize empty.
Error: Error: Gradle script '/home/runner/work/Slapbot-stewie/Slapbot-stewie/gradlew' is not executable.

我不知道如何解决这个错误,我没有找到相关的谷歌搜索可以帮助解决这个问题。

【问题讨论】:

    标签: java spring-boot gradle yaml github-actions


    【解决方案1】:

    参数只是构建,因为您使用的是 gradle 操作而不是 ./gradlew :

    - name: Build with Gradle
      uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
       with:
          arguments: build
    

    【讨论】:

      猜你喜欢
      • 2020-09-11
      • 2022-10-02
      • 2021-10-29
      • 2021-08-04
      • 1970-01-01
      • 2021-05-21
      • 2023-02-01
      • 1970-01-01
      • 2020-01-10
      相关资源
      最近更新 更多