diff --git a/.github/workflows/simver.yaml b/.github/workflows/simver.yaml index 27a2f21..3daf96f 100644 --- a/.github/workflows/simver.yaml +++ b/.github/workflows/simver.yaml @@ -2,12 +2,11 @@ name: simver, concurrency: { group: simver, cancel-in-progress: false }, permissions: { id-token: write, contents: write, pull-requests: read }, - on: - { + on: { workflow_dispatch: null, workflow_call: {}, - push: { branches: [main] }, - pull_request: { types: [opened, synchronize, reopened, closed] }, + # push: { branches: [main] }, + # pull_request: { types: [opened, synchronize, reopened, closed] }, }, defaults: { run: { shell: bash } }, jobs: @@ -15,7 +14,6 @@ simver: { runs-on: ubuntu-latest, - steps: [ { @@ -23,24 +21,38 @@ uses: "actions/checkout@v4", with: { fetch-depth: 0 }, }, + { + name: checkout code, + uses: "actions/checkout@v4", + with: + { + fetch-depth: 0, + repository: "walteh/simver", + ref: "{{ env.GITHUB_WORKFLOW_SHA }}", + path: "__simver__", + }, + }, + { + name: get current go version from go.mod, + id: go-version, + run: 'cat go.mod | grep ''go '' | awk ''{print $2}'' | xargs -I {} echo "GO_VERSION={}" >> $GITHUB_ENV', + }, { name: setup golang, uses: "actions/setup-go@v4", - with: { go-version: 1.21.4 }, + with: { go-version: "{{ env.GO_VERSION }}" }, }, { - name: install simver, - run: "go install github.com/walteh/simver/cmd/simver_github_actions@v0.22.0", + name: install dependencies, + run: "cd __simver__ && go mod download", }, { - name: run simver, - id: simver, + name: install simver, env: { - SIMVER_READ_ONLY: false, GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}", }, - run: simver_github_actions, + run: "go run ./__simver__/cmd/simver_gha --read-only=false", }, ], }, diff --git a/.github/workflows/wait-on-simver.yaml b/.github/workflows/wait-on-simver.yaml index 6973ac4..db92c51 100644 --- a/.github/workflows/wait-on-simver.yaml +++ b/.github/workflows/wait-on-simver.yaml @@ -25,7 +25,7 @@ }, { name: install simver, - run: "go install github.com/walteh/simver/cmd/wait_on_simver_github_actions@wait-on-simver-test-c", + run: "go install github.com/walteh/simver/cmd/wait_on_gha@wait-on-simver-test-c", }, { name: run simver, @@ -36,7 +36,7 @@ SIMVER_INTERVAL: "10s", GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}", }, - run: wait_on_simver_github_actions, + run: wait_on_simver_gha, }, ], },