generated from arcus-azure/arcus.github.template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: auto-bump new docs version workflow (#280)
- Loading branch information
1 parent
380e51c
commit 483257d
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Bump new docs version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Specify the new version to bump (e.g. v1.1.0)' | ||
required: true | ||
|
||
jobs: | ||
generate-new-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: navigate to docs folder | ||
run: cd docs | ||
|
||
- name: Install npm dependencies | ||
run: npm install | ||
|
||
- name: Generate new version | ||
run: npm run docusaurus docs:version ${{ github.event.inputs.version }} | ||
|
||
- name: Check for changes | ||
run: | | ||
if git diff --quiet; then | ||
echo "No changes detected." | ||
exit 0 | ||
fi | ||
- name: Configure Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
branch: "docs(${{ github.event.inputs.version }})/bump-docs-version" | ||
title: "docs(${{ github.event.inputs.version }}): bump new docs version" | ||
body: "This automatically generated PR bumps the docs version to ${{ github.event.inputs.version }}." | ||
commit-message: "docs(${{ github.event.inputs.version }}): bump new docs version" | ||
delete-branch: true |