Fixed broken "check_api" method #9
Workflow file for this run
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: 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 would be: $NEW_VERSION" | |
echo "::set-output name=new_version::$NEW_VERSION" | |
- 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: ${{ steps.preview.outputs.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 }}" |