Skip to content

fix(opsgenie): retry 404 again (#2937) #26

fix(opsgenie): retry 404 again (#2937)

fix(opsgenie): retry 404 again (#2937) #26

Workflow file for this run

name: Auto Release on Version Change
on:
push:
branches:
- main
paths:
- "pyproject.toml"
jobs:
check-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Extract version from pyproject.toml
id: get_version
run: |
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if release exists
id: check_release
run: |
TAG_EXISTS=$(git tag -l "v${{ steps.get_version.outputs.version }}")
if [ -z "$TAG_EXISTS" ]; then
echo "exists=false" >> $GITHUB_OUTPUT
else
echo "exists=true" >> $GITHUB_OUTPUT
fi
- name: Create Release
if: steps.check_release.outputs.exists == 'false'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}