From 50f4f3efe1646f56653db5df1b942cdd5edbd521 Mon Sep 17 00:00:00 2001 From: machernyavskiy Date: Tue, 5 Mar 2024 12:50:58 +0300 Subject: [PATCH] [#120] actions/github-script@v7: add submodule tags automatically --- .github/workflows/release.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e87a858..4d5b431 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,9 @@ jobs: release: runs-on: ubuntu-latest steps: - - name: Print tag + - name: Print ref name run: | - echo "${{ github.ref }}" + echo "${{ github.ref_name }}" - name: Checkout uses: actions/checkout@v3 with: @@ -30,4 +30,21 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution - # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} + - name: Set submodule tags + uses: actions/github-script@v7 + with: + script: | + const creator = github.ref_name + let submodules: string[] = ['stdlib', 'pgx', 'sqlx', 'gorm']; + + for (const submodule of submodules) { + echo 'refs/tags/${{ ref_name }}' + } + +# github.rest.git.createRef({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# ref: 'refs/tags/', +# sha: context.sha +# }) \ No newline at end of file