Skip to content

automatic update

automatic update #37

Workflow file for this run

name: automatic update
on:
workflow_dispatch:
push:
branches:
- master
jobs:
skip:
runs-on: ubuntu-latest
steps:
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
release:
name: release
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
- name: Generate files by openapi-generator
run: sh ./generate.sh
- name: Check diff
run: |
git add .
DIFFS=`git diff --name-only HEAD`
echo $DIFFS
if [ "$DIFFS" = '' ]; then
echo "HAS_DIFF=false" >> $GITHUB_ENV
else
echo "HAS_DIFF=true" >> $GITHUB_ENV
fi
git reset HEAD
- name: git commit and push
if: env.HAS_DIFF == 'true'
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add .
git commit -m "CI: regenerate [ci skip]" --author="ras0q <[email protected]>"
git push origin master