Skip to content

Commit

Permalink
Use the planetscale/ghcommit-action
Browse files Browse the repository at this point in the history
  • Loading branch information
jagudelo-gap committed Sep 9, 2024
1 parent 11f3b6e commit 3cc4760
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/openapi-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ name: Create PR to update doc and openapi definition
on:
workflow_dispatch:
inputs:
version:
description: 'API Version [format 0.0.0]'
version-name:
description: 'Version Name. Example -> 2.2.2 will result "admin-api-2.2.2.yaml" "admin-api-2.2.2-summary.md"'
required: true
type: string
permissions: write-all
Expand All @@ -18,7 +18,7 @@ env:
CI_COMMIT_MESSAGE: Add YAML and markdown file api-specification version ${{ inputs.version }}
CI_COMMIT_AUTHOR: github-actions[bot]
CI_COMMIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
BRANCH_NAME: openapi-${{ inputs.version }}

jobs:
Expand Down Expand Up @@ -58,14 +58,12 @@ jobs:
- name: Commit file
id: commit
uses: ryancyq/github-signed-commit@v1
uses: planetscale/[email protected]
with:
branch-name: ${{ env.BRANCH_NAME }}
files: |
docs/api-specifications/markdown
docs/api-specifications/openapi-yaml
commit-message: ${{ env.CI_COMMIT_MESSAGE }}
commit_message: "${{ env.CI_COMMIT_MESSAGE }}"
repo: ${{ github.repository }}
branch: ${{ env.BRANCH_NAME }}
file_pattern: '*.yaml *.md'

- name: Create PR
if: ${{ steps.commit.outputs.commit-sha != null }}
run: gh pr create -B main -H ${{ env.BRANCH_NAME }} --title '[Github Action] Open API documentation version ${{ inputs.version }}' --body 'Created by Github action'

0 comments on commit 3cc4760

Please sign in to comment.