From 264b03df056feaa144897020b80a2e743fc3a5e6 Mon Sep 17 00:00:00 2001 From: Walter Scott Date: Sat, 25 May 2024 10:04:16 -0500 Subject: [PATCH] source --- action.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/action.yaml b/action.yaml index 55f0ea2..fb1f37f 100644 --- a/action.yaml +++ b/action.yaml @@ -4,9 +4,11 @@ inputs: { GITHUB_TOKEN: { description: "GitHub token", required: true } } runs: using: "composite" steps: + - name: checkout source code uses: actions/checkout@v4 with: + path: __source__ fetch-depth: 0 - name: get current action ref @@ -14,23 +16,18 @@ runs: shell: bash run: "echo '${{ github.action_path }}' | sed -n 's/.*walteh\\/simver\\///p' | xargs -I {} echo 'SIMVER_GITHUB_ACTION_REF={}' >> $GITHUB_ENV" - - name: get temp directory - id: get-temp-dir - shell: bash - run: "echo '${{ runner.temp }}/__simver__' | xargs -I {} echo 'SIMVER_TEMP_DIR={}' >> $GITHUB_ENV" - - name: checkout simver code uses: actions/checkout@v4 with: fetch-depth: 0 repository: walteh/simver ref: ${{ env.SIMVER_GITHUB_ACTION_REF }} - path: ${{ env.SIMVER_TEMP_DIR }} + path: __simver__ - name: get current go version from go.mod id: go-version shell: bash - working-directory: ${{ env.SIMVER_TEMP_DIR }} + working-directory: __simver__ run: 'cat go.mod | grep ''go '' | awk ''{print $2}'' | xargs -I {} echo "GO_VERSION={}" >> $GITHUB_ENV' - name: setup golang @@ -40,16 +37,17 @@ runs: - name: download dependencies shell: bash - working-directory: ${{ env.SIMVER_TEMP_DIR }} + working-directory: __simver__ run: "go mod download" - name: install simver shell: bash - working-directory: ${{ env.SIMVER_TEMP_DIR }} + working-directory: __simver__ run: "go install ./cmd/simver_gha" - name: run simver shell: bash + working-directory: __source__ env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: "simver_gha --read-only=false"