Support whitespace in tag keys and values #81
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: Release | |
| on: | |
| pull_request: | |
| types: [closed] | |
| permissions: | |
| contents: write # Create releases | |
| jobs: | |
| release: | |
| # will only be triggered if PR title begins with [POST-RELEASE v*.*.*] | |
| name: Release | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event.pull_request.merged == true && | |
| startsWith(github.event.pull_request.title, '[POST-RELEASE') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Extract version and create tag | |
| id: tag-version | |
| run: | | |
| PR_TITLE="${{ github.event.pull_request.title }}" | |
| VERSION=$(echo "$PR_TITLE" | grep -oE '^\[POST-RELEASE v[0-9]+\.[0-9]+\.[0-9]+\]' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+') | |
| if [ -z "$VERSION" ]; then | |
| echo "Error: PR title must start with [POST-RELEASE vx.x.x]" | |
| exit 1 | |
| fi | |
| echo "Extracted VERSION: $VERSION" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "[email protected]" | |
| git tag $VERSION | |
| git push origin $VERSION | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| id: create-release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.tag-version.outputs.version }} | |
| release_name: ${{ steps.tag-version.outputs.version }} | |
| body: | | |
| AWS EFS CSI Driver | |
| ## CHANGELOG | |
| See [CHANGELOG](https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/CHANGELOG-2.x.md) for full list of changes | |
| draft: false | |
| prerelease: false |