Bump com.sshtools:maverick-synergy-client from 3.1.2 to 3.1.4 in /server #13
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: 'create tag on release prepare PR merge' | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| jobs: | |
| tagging: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| steps: | |
| - name: extract tag name from branch | |
| id: tag_extraction | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | |
| if [[ "$BRANCH_NAME" =~ ^prepare-v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| VERSION_TAG="${BRANCH_NAME#prepare-}" | |
| echo "version_tag=$VERSION_TAG" >> "$GITHUB_OUTPUT" | |
| echo "extracted tag: $VERSION_TAG" | |
| else | |
| echo "Branch '$BRANCH_NAME' does not match 'prepare-vX.Y.Z'; skipping." | |
| echo "version_tag=" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create and Push Tag | |
| if: steps.tag_extraction.outputs.version_tag != '' | |
| env: | |
| TAG_NAME: ${{ steps.tag_extraction.outputs.version_tag }} | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const pr = context.payload.pull_request; | |
| const tag = process.env.TAG_NAME; | |
| const targetSha = pr.merge_commit_sha; | |
| console.log(`Creating tag ${tag}`); | |
| await github.rest.git.createRef({ | |
| owner: owner, | |
| repo: repo, | |
| ref: `refs/tags/${tag}`, | |
| sha: targetSha | |
| }); | |
| console.log(`Successfully created tag ${tag}`); |