Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update dependent projects (v2) | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: 'Tag name' | |
required: false | |
prerelease: | |
description: 'Prerelease' | |
required: false | |
default: 'false' | |
env: | |
LIBRARY_NAME: "gisce/ooui" | |
jobs: | |
update-dependents: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- project: "gisce/react-ooui" | |
branch: "v2" | |
steps: | |
- name: Set environment variables and check condition | |
run: | | |
TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.tag_name }}" | |
PRERELEASE="${{ github.event.release.prerelease || github.event.inputs.prerelease }}" | |
if [ "$PRERELEASE" != "true" ] && [[ "$TAG_NAME" == *'v2'* ]]; then | |
SHOULD_RUN="true" | |
else | |
SHOULD_RUN="false" | |
fi | |
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV | |
echo "SHOULD_RUN=$SHOULD_RUN" >> $GITHUB_ENV | |
- name: Check Prerelease and Tag Version | |
if: env.SHOULD_RUN == 'true' | |
run: echo "Running update for tag ${{ env.TAG_NAME }}" | |
- name: Call Reusable Workflow for each project | |
if: env.SHOULD_RUN == 'true' | |
uses: gisce/[email protected] | |
with: | |
dependentProject: ${{ matrix.project }} | |
tagName: ${{ env.TAG_NAME }} | |
dependentProjectBranch: ${{ matrix.branch }} | |
libraryName: ${{ env.LIBRARY_NAME }} | |
githubToken: ${{ secrets.GH_PAT }} |