Skip to content

Commit

Permalink
source
Browse files Browse the repository at this point in the history
  • Loading branch information
walteh committed May 25, 2024
1 parent d89235a commit 264b03d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,30 @@ 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
id: get-action-ref
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
Expand All @@ -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"

0 comments on commit 264b03d

Please sign in to comment.