Skip to content

Commit

Permalink
updating workflow to check if [ci commit] is in the message and if it…
Browse files Browse the repository at this point in the history
… is we wont run the jobs below (#762)
  • Loading branch information
kevkevinpal authored Sep 8, 2023
1 parent 1da0799 commit 5ecbd66
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/lint_format_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- name: Check Commit Message
id: commit-message-check
run: |
COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{ github.sha }})
if [[ $COMMIT_MESSAGE == *"[ci commit]"* ]]; then
echo "Commit message contains [ci commit], exiting workflow."
exit 0
fi
shell: bash
- name: checkout
uses: actions/checkout@v3
with:
Expand All @@ -25,14 +34,14 @@ jobs:
npm run lint || echo -n
npx prettier --config .prettierrc --ignore-path .prettierignore -w *.ts src/**/*.ts
git add *.ts src
git commit -m '[skip ci] Lint and format code' || echo -n
git commit -m '[ci commit] Lint and format code' || echo -n
git push
npm run build
git add dist --force
git commit -m '[skip ci] Automatic build' || echo -n
git commit -m '[ci commit] Automatic build' || echo -n
git push
bash grpc_gen_types.sh
npm run build
git add src/grpc/types src/grpc/proto.ts dist --force
git commit -m '[skip ci] Update proto files and types' || echo -n
git commit -m '[ci commit] Update proto files and types' || echo -n
git push

0 comments on commit 5ecbd66

Please sign in to comment.