Update translation-guidelines.md #323
Workflow file for this run
This file contains hidden or 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: Prepare Version Bump | |
| 'on': | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| jobs: | |
| check-merged: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| merged: ${{ steps.check.outputs.merged }} | |
| steps: | |
| - name: Check if PR is merged | |
| id: check | |
| run: | | |
| if [[ "${{ github.event.pull_request.merged }}" != "true" ]]; then | |
| echo "### ❌ Pull Request Not Merged" >> $GITHUB_STEP_SUMMARY | |
| echo "Pull request is not merged. Exiting." | |
| echo "merged=false" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "### ✅ Pull Request Merged" >> $GITHUB_STEP_SUMMARY | |
| echo "merged=true" >> $GITHUB_OUTPUT | |
| fi | |
| shell: bash | |
| get-labels: | |
| needs: check-merged | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version_type: ${{ steps.get.outputs.version_type }} | |
| steps: | |
| # This step requires that the repo has 3 types of version bump labels. Make any adjustments as | |
| # needed to ensure that this step accurately parses the bump type. | |
| # - version:patch | |
| # - version:minor | |
| # - version:major | |
| - name: Get labels | |
| id: get | |
| run: | | |
| LABELS="${{ join(github.event.pull_request.labels.*.name, ' ') }}" | |
| VERSION_LABELS=$(echo $LABELS | tr ' ' '\n' | grep -E '^version-(patch|minor|major)$' || true) | |
| LABELS_COUNT=$(echo "$VERSION_LABELS" | wc -w) | |
| if [[ "$LABELS_COUNT" -ne 1 ]]; then | |
| echo "### ❌ Version Label Error" >> $GITHUB_STEP_SUMMARY | |
| echo "Exactly one version label is required. Exiting." | |
| exit 1 | |
| fi | |
| VERSION_TYPE=$(echo "$VERSION_LABELS" | sed 's/^version-//') | |
| echo "version_type=$VERSION_TYPE" >> $GITHUB_OUTPUT | |
| echo "$VERSION_TYPE" > version.txt | |
| echo "### ✅ Valid Version Label" >> $GITHUB_STEP_SUMMARY | |
| echo "Version label is valid. Version type: $VERSION_TYPE." | |
| shell: bash | |
| - name: Archive version | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'version-${{ github.run_id }}' | |
| path: version.txt | |
| - name: Summarize version archiving | |
| run: | | |
| echo "### ✅ Version File Archived" >> $GITHUB_STEP_SUMMARY | |
| echo "The version type `version.txt` has been archived under the name `version-${{ github.run_id }}`." | |
| shell: bash |