'Unable to run a gradle github workflow

I am trying to set up a workflow for my project. I used the standard "Configure with gradle" workflow, and just edited the java version from 11 to 17.

But when I push my code, it throws an error:

this is my workflow so far

# 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.

I do not know how to fix this error, I found no relevant google search that can help with this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source