35 lines (32 loc) · 1.17 KB
/
sync-module-tags.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
on:
push:
tags: ['v*']
permissions:
contents: write
# When a repository has multiple Go modules, in order to version the non-root
# modules, the repo must have a tag named like '<module>/<version>'. This
# workflow responds to pushes of tags named like "vXXX" by also tagging
# <module>/<version> accordingly, for all sub-Go-modules.
#
# For example, when tagging v2.3.4, this workflow will tag the same commit with
# pkg/signature/kms/aws/v2.3.4, so that the kms/aws module is also tagged
# v2.3.4.
jobs:
sync-tags:
runs-on: ubuntu-latest
strategy:
matrix:
module:
- pkg/signature/kms/aws
- pkg/signature/kms/azure
- pkg/signature/kms/gcp
- pkg/signature/kms/hashivault
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- run: |
tag="${{ matrix.module }}/${{ github.ref_name }}"
echo tagging "${tag}"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "syncing module ${{ matrix.module }} @ ${{ github.ref_name }}"
git push origin "${tag}"