diff --git a/.github/templates/run-script-and-commit/action.yaml b/.github/templates/run-script-and-commit/action.yaml index 3c2ddf72a4..c87dc18584 100644 --- a/.github/templates/run-script-and-commit/action.yaml +++ b/.github/templates/run-script-and-commit/action.yaml @@ -24,9 +24,9 @@ inputs: passphrase: description: "Passphrase for the GPG key." required: true - repo-path: - description: "Path to the repository." - default: "" + go-mod-path: + description: "Path to go.mod file. If the file exists, Go will be set up." + default: "go.mod" required: false branch: description: "Branch to checkout." @@ -39,13 +39,15 @@ runs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 with: fetch-depth: 0 + fetch-tags: true token: ${{ inputs.apix_bot_pat }} ref: ${{ inputs.branch }} - name: Set up Go + if: ${{ hashFiles(inputs.go-mod-path) != '' }} uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c with: - go-version-file: ${{ format('{0}go.mod', inputs.repo-path) }} + go-version-file: ${{ inputs.go-mod-path }} - name: Run specified script shell: bash run: ${{ inputs.script_call }}