Skip to content

Fixed broken "check_api" method #10

Fixed broken "check_api" method

Fixed broken "check_api" method #10

Workflow file for this run

name: Automated Version Management
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- main
jobs:
preview-bump:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: "Preview version bump"
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Preview version bump
id: preview
run: |
if git log -1 --pretty=%B | grep -qE '^(feat|fix|BREAKING CHANGE):|#(minor|major)'; then
NEW_VERSION=$(cz bump --dry-run --yes --list | grep new_version | sed -r s,"^.*=",,)
else
NEW_VERSION=$(cz bump --dry-run --yes --increment PATCH --list | grep new_version | sed -r s,"^.*=",,)
fi
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
- name: Comment PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PAT }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: 'dougollerenshaw',
repo: 'CodeAIde',
body: `When merged, this PR will bump the version to: ${process.env.new_version}`
})
bump-version:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
name: "Bump version and create changelog"
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Bump version
id: bump
run: |
if git log -1 --pretty=%B | grep -qE '^(feat|fix|BREAKING CHANGE):|#(minor|major)'; then
cz bump --yes
else
cz bump --increment PATCH --yes
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Print Version
run: echo "Bumped to version ${{ steps.bump.outputs.new_version }}"