Skip to content

On Commit action

On Commit action #111

Workflow file for this run

name: On Commit action
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches: ["main"]
jobs:
get_base_commit:
runs-on: ubuntu-latest
outputs:
commit_number: ${{ steps.get_commits.outputs.commit_number }}
steps:
- name: get number of commits pushed
id: get_commits
env:
EVENT_COMMITS: ${{toJson(github.event.commits)}}
run: |
echo "$EVENT_COMMITS" > commits.json
tr -d '\n' < commits.json > commits_oneline.json
LL=$( jq '. | length' commits_oneline.json)
echo 'Number of commits pushed: $LL'
echo "commit_number=$LL" > $GITHUB_OUTPUT
verify_changes:
if: ${{github.event.schedule}} != ""
needs: get_base_commit
uses: ./.github/workflows/validate_code_style.yml
with:
reference_commit: "HEAD~${{needs.get_base_commit.outputs.commit_number}}"
build_samples:
uses: ./.github/workflows/samples_build.yml
build_and_run_tests:
uses: ./.github/workflows/run_tests.yml