on:
  push:
    paths:
      - '.github/workflows/ci.yml'
      - 'bin/import'
      - 'db/schema.sql'
  pull_request:
    branches:
      - main
  schedule:
    - cron: '0 0 * * *'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Get branch name
        id: branch-name
        uses: tj-actions/branch-names@v6

      - name: Set Git Tag name
        id: date
        run: |
          echo "{tag_name}=v{$(date +'%Y-%m-%d')}" >> $GITHUB_ENV

      - name: checkout repo content
        uses: actions/checkout@v3 # checkout the repository content to github runner

      - name: import contributions
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
        run: make import

      - name: commit & push changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          ref: '${{ steps.branch-name.outputs.current_branch }}'
          commit_message: '${{ env.tag_name }}'
          tagging_message: '${{ env.tag_name }}'

          commit_user_name: GitHub Actions
          commit_author:
            Author <actions@github.com> # defaults to author of the commit that triggered the run


            # See https://git-scm.com/docs/git-add#_options
          add_options:
            '-u'

            # See https://git-scm.com/docs/git-push#_options
          push_options:
            '--force'

            # Optional. Create given branch name in local and remote repository.
          create_branch: true

on:
  push:
    paths:
      - '.github/workflows/ci.yml'
      - 'bin/import'
      - 'db/schema.sql'
  pull_request:
    branches:
      - main
  schedule:
    - cron: '0 0 * * *'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Get branch name
        id: branch-name
        uses: tj-actions/branch-names@v6

      - name: checkout repo content
        uses: actions/checkout@v3 # checkout the repository content to github runner

      - name: import contributions
        env:
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
        run: make import

      - name: commit & push changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          ref: '${{ steps.branch-name.outputs.current_branch }}'
          commit_message: 'Build website'

          commit_user_name: GitHub Actions
          commit_author:
            GitHub Actions <actions@github.com> # defaults to author of the commit that triggered the run


            # See https://git-scm.com/docs/git-add#_options
          add_options:
            '-u'

            # See https://git-scm.com/docs/git-push#_options
          push_options:
            '--force'

            # Optional. Create given branch name in local and remote repository.
          create_branch: true

Simplify the workflow, by removing the creation of the Git tag
Simplify the workflow, by removing the creation of the Git tag
