ignore commented images (AST-65541) #9
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: Release Containers resolver Go module new version | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
jobs: | |
tag-and-release: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Git auth config | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "${{ secrets.GH_USERNAME}}" | |
- name: Get and Format the PR Title | |
id: get_pr_title | |
run: | | |
pr_title="${{ github.event.pull_request.title }}" | |
# Use grep with regex to extract the format (AST-000) from the title | |
formatted_title=$(echo "$pr_title" | grep -oE "\(AST-[0-9]+\)") | |
# If formatted_title is empty, set a default value or handle the error | |
if [ -z "$formatted_title" ]; then | |
echo "No valid format found in PR title." | |
exit 1 | |
fi | |
echo "formatted_title=$formatted_title" >> $GITHUB_ENV | |
- name: Fetch All Tags | |
run: git fetch --tags | |
- name: Get Latest Tag | |
id: get_tag | |
run: | | |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo "tag=${latest_tag}" >> $GITHUB_ENV | |
- name: Bump Patch Version | |
id: bump | |
uses: cbrgm/semver-bump-action@main | |
with: | |
current-version: ${{ env.tag }} | |
bump-level: patch | |
- name: Create a new tag | |
run: | | |
new_tag=${{ steps.bump.outputs.new_version }} | |
git tag $new_tag -m "${{ env.formatted_title }}" | |
git push origin $new_tag | |
- name: Create release from tag | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.bump.outputs.new_version }} | |
release_name: Release ${{ steps.bump.outputs.new_version }} | |
body: ${{ steps.get_pr_title.outputs.pr_title }} | |
draft: false | |
prerelease: false |