Skip to content

Generate Release PR #15

Generate Release PR

Generate Release PR #15

name: Generate Release PR
on:
workflow_dispatch:
jobs:
generate-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Batch changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: batch auto
- name: Merge changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: merge
- name: Get the latest version
id: latest
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest
- name: Update README.md example to ${{ steps.latest.outputs.output }}
run: |
LATEST_VERSION=${{ steps.latest.outputs.output }}
LATEST_VERSION_STRIPPED=${LATEST_VERSION#v}
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/version: [0-9]*\.[0-9]*\.[0-9]*/version: ${LATEST_VERSION_STRIPPED}/" README.md
else
sed -i "s/version: [0-9]*\.[0-9]*\.[0-9]*/version: ${LATEST_VERSION_STRIPPED}/" README.md
fi
- name: Update version in /macros/set_query_comment.sql
run: |
LATEST_VERSION=${{ steps.latest.outputs.output }}
LATEST_VERSION_STRIPPED=${LATEST_VERSION#v}
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/dbt_bigquery_monitoring_version=\"[0-9]*\.[0-9]*\.[0-9]*\",/dbt_bigquery_monitoring_version=\"${LATEST_VERSION_STRIPPED}\",/" macros/set_query_comment.sql
else
sed -i "s/dbt_bigquery_monitoring_version=\"[0-9]*\.[0-9]*\.[0-9]*\",/dbt_bigquery_monitoring_version=\"${LATEST_VERSION_STRIPPED}\",/" macros/set_query_comment.sql
fi
- name: Update version in /dbt_project.yml
run: |
LATEST_VERSION=${{ steps.latest.outputs.output }}
LATEST_VERSION_STRIPPED=${LATEST_VERSION#v}
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"${LATEST_VERSION_STRIPPED}\"/" dbt_project.yml
else
sed -i "s/version: \"[0-9]*\.[0-9]*\.[0-9]*\"/version: \"${LATEST_VERSION_STRIPPED}\"/" dbt_project.yml
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: Release ${{ steps.latest.outputs.output }}
branch: release/${{ steps.latest.outputs.output }}
commit-message: Release ${{ steps.latest.outputs.output }}