Skip to content

Commit

Permalink
[#120] actions/github-script@v7: add submodule tags automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
machernyavskiy committed Mar 5, 2024
1 parent d3164ec commit 4bfeb40
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Print tag
run: |
echo "${{ github.ref }}"
echo "${{ github.ref_name }}"
- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -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 }}
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- name: Set submodule tags
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
with:
script: |
var submodules = ['stdlib', 'pgx', 'sqlx', 'gorm']
for (const submodule of submodules) {
var tag = `refs/tags/${submodule}/${{ github.ref_name }}`
console.log(`add submodule tag: ${tag}`)
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: '${tag}',
sha: context.sha
})
}

0 comments on commit 4bfeb40

Please sign in to comment.