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 5c956d1 commit 7ce9de3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Print ref name
- name: Print tag
run: |
echo "${{ github.ref_name }}"
- name: Checkout
Expand All @@ -34,8 +34,16 @@ jobs:
- name: Set submodule tags
uses: actions/github-script@v7
with:
script: |
github-token: ${{ secrets.RELEASE_GITHUB_TOKEN }}}
script: |
var submodules = ['stdlib', 'pgx', 'sqlx', 'gorm']
for (const submodule of submodules) {
console.log(`refs/tags/${submodule}/${{ github.ref_name }}`)
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 7ce9de3

Please sign in to comment.