Skip to content

Commit

Permalink
CI update [no_ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kseen715 committed Aug 18, 2024
1 parent 1a59b2b commit 3877e0e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/on-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ jobs:
check-no-ci:
runs-on: ubuntu-latest
needs: fetch-commit-message
outputs:
no_ci: ${{ steps.check_no_ci.outputs.no_ci }}
steps:
- name: "Check for [no_ci] in commit message"
id: check_no_ci
run: |
if echo "${{ needs.fetch-commit-message.outputs.commit_message }}" | grep -iq '\[no_ci\]'; then
echo "Skipping CI run due to [no_ci] in commit message"
exit 0
echo "::set-output name=no_ci::true"
else
echo "::set-output name=no_ci::false"
fi
run-main:
runs-on: ubuntu-latest
needs: check-no-ci
if: needs.check-no-ci.outputs.no_ci == 'false'
steps:
- uses: actions/checkout@v2
- name: "Set up Python"
Expand All @@ -44,7 +49,10 @@ jobs:

commit-results:
runs-on: ubuntu-latest
needs: run-main
needs:
- check-no-ci
- run-main
if: needs.check-no-ci.outputs.no_ci == 'false'
steps:
- uses: actions/checkout@v2
- name: "Commit results"
Expand All @@ -53,4 +61,13 @@ jobs:
git config --global user.name "GitHub Actions"
git add .
git commit -m "Github Actions CI" || echo "Nothing to commit"
git push || echo "Nothing to push"
git push || echo "Nothing to push"
# skip-ci:
# runs-on: ubuntu-latest
# needs:
# - check-no-ci
# if: needs.check-no-ci.outputs.no_ci == 'true'
# steps:
# - name: "Skip CI"
# run: echo "CI skipped due to [no_ci] in commit message"

0 comments on commit 3877e0e

Please sign in to comment.