'GitHub Actions chmod: cannot access './gradlew': No such file or directory

Im using GitHub Actions for the first time with a Gradle project, I have added a .github/workflows/ci.yml file to my root directory and GitHub recognizes the action to problem. But when the action runs im left with the error "chmod: cannot access './gradlew': No such file or directory" Im unsure how to fix this at this point so any help would be appreciated im attaching my ci.yml file below!

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
        run: chmod +x ./gradlew
      - name: Build
        run: ./gradlew build
      - name: Test
        run: ./gradlew test

I tried git update-index --chmod=+x gradlew git commit -m "Make gradlew executable" in my terminal but it told me no files were altered im using IntelliJ to write this!



Solution 1:[1]

try the following:

git update-index --chmod=+x gradlew
git add gradlew
git commit -m "fix executable"
git push

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 Dmitry