Merge pull request #1826 from sykim-etri/develop #337
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: Apply make swagger | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/core/**/**.go' | |
- 'src/api/rest/server/**/**.go' | |
jobs: | |
update-swagger-doc: | |
name: Update Swagger doc | |
if: github.repository == 'cloud-barista/cb-tumblebug' | |
# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06) | |
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.23.0' ] | |
steps: | |
- name: Set up Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Install swag | |
run: | | |
go install github.com/swaggo/swag/cmd/swag@latest | |
- name: Update Swagger doc | |
run: | | |
cd src/ | |
make swag | |
# - name: Commit generated Swagger docs | |
# uses: stefanzweifel/git-auto-commit-action@v4 | |
# with: | |
# file_pattern: src/api/rest/docs/** | |
# commit_message: Update Swagger docs | |
- name: Force-Add Swagger doc files | |
run: | | |
cd src/api/rest/docs/ | |
git add -f -v docs.go swagger.json swagger.yaml | |
- name: Create Pull Request | |
id: create-pull-request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.UPDATE_SWAGGER_DOC_PAT }} | |
commit-message: Update Swagger REST API doc | |
committer: cb-bot <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
branch: update-swagger-doc | |
base: main | |
delete-branch: true | |
title: '[Workflow] Update Swagger REST API doc' | |
body: | | |
Update Swagger REST API doc | |
- Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
labels: | | |
swagger | |
automated pr | |
assignees: cloud-barista/cb-tumblebug-maintainer | |
reviewers: cloud-barista/cb-tumblebug-maintainer | |
team-reviewers: | | |
owners | |
maintainers | |
draft: false | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ steps.create-pull-request.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.create-pull-request.outputs.pull-request-url }}" | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Dump job context | |
env: | |
JOB_CONTEXT: ${{ toJson(job) }} | |
run: echo "$JOB_CONTEXT" | |
- name: Dump steps context | |
env: | |
STEPS_CONTEXT: ${{ toJson(steps) }} | |
run: echo "$STEPS_CONTEXT" | |
- name: Dump runner context | |
env: | |
RUNNER_CONTEXT: ${{ toJson(runner) }} | |
run: echo "$RUNNER_CONTEXT" | |
- name: Dump strategy context | |
env: | |
STRATEGY_CONTEXT: ${{ toJson(strategy) }} | |
run: echo "$STRATEGY_CONTEXT" | |
- name: Dump matrix context | |
env: | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
run: echo "$MATRIX_CONTEXT" |