Skip to content

Commit

Permalink
Merge pull request #68 from NikitaSkrynnik/get-tag
Browse files Browse the repository at this point in the history
Add get-tag job to release-dependent-repositories workflow
  • Loading branch information
denis-tingaikin authored May 19, 2024
2 parents aae7301 + 1c69633 commit b986bff
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/release-dependent-repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
tag:
type: string
required: true
required: false
dependent_repositories:
description: array of dependent repositories in json format
type: string
Expand All @@ -14,16 +14,34 @@ on:
token:
required: true
jobs:
get-tag:
name: Get tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get-tag-step.outputs.tag }}
steps:
- name: Get tag
run: |
tag=${{ inputs.tag }}
if [ -z "$tag" ]; then
branch=${{ github.event.workflow_run.head_branch }}
tag=${branch#release/}
fi
echo "$tag"
echo tag=${tag} >> $GITHUB_OUTPUT
id: get-tag-step

release-dependent-repositories:
strategy:
matrix:
repository: ${{ fromJson(inputs.dependent_repositories) }}
name: Update ${{ matrix.repository }}
runs-on: ubuntu-latest
needs: get-tag
steps:
- name: Create commit
run: |
echo "Update go.mod and go.sum to ${{ github.repository }}@${{ inputs.tag }}" >> /tmp/commit-message
echo "Update go.mod and go.sum to ${{ github.repository }}@${{ needs.get-tag.outputs.tag }}" >> /tmp/commit-message
- name: Checkout networkservicemesh/${{ matrix.repository }}
uses: actions/checkout@v4
with:
Expand All @@ -36,7 +54,7 @@ jobs:
- name: Update ${{ matrix.repository }} locally
working-directory: networkservicemesh/${{ matrix.repository }}
run: |
GOPRIVATE=github.com/networkservicemesh go get -u github.com/${{ github.repository }}@${{ inputs.tag }}
GOPRIVATE=github.com/networkservicemesh go get -u github.com/${{ github.repository }}@${{ needs.get-tag.outputs.tag }}
go mod tidy
git diff
- name: Push update to the ${{ matrix.repository }}
Expand Down

0 comments on commit b986bff

Please sign in to comment.