<NME> sync_configs.yml
<BEF> # This file is synced from dry-rb/template-gem repo

name: sync

on:
  repository_dispatch:
  push:
    branches:
      - "main"

jobs:
  main:
    runs-on: ubuntu-latest
    if: (github.event_name == 'repository_dispatch' && github.event.action == 'sync_configs') || github.event_name != 'repository_dispatch'
    env:
      GITHUB_LOGIN: dry-bot
      GITHUB_TOKEN: ${{ secrets.GH_PAT }}
    steps:
      - name: Checkout ${{github.repository}}
        uses: actions/checkout@v2
      - name: Checkout devtools
        uses: actions/checkout@v2
        with:
          repository: dry-rb/devtools
          path: tmp/devtools
      - name: Setup git user
        run: |
          git config --local user.email "dry-bot@dry-rb.org"
          git config --local user.name "dry-bot"
      - name: Set up Ruby
        uses: actions/setup-ruby@v1
        with:
          ruby-version: "2.7"
      - name: Install dependencies
        run: gem install ossy --no-document
              bin/ossy t c tmp/devtools/templates/$t $(basename $t .erb) project.yml
            done
          fi
      - name: Merge configuration files from devtools
        run: |
          for f in `ls tmp/devtools/workflows/*.yml`
          do
            n="$(basename $f)";
            c=".github/workflows/custom/$n";
            [ -f $c ] && bin/ossy c m $f $c .github/workflows/$n || echo "no custom config found for $f"
          done
      - name: Update configuration files from devtools
        run: |

<MSG> [devtools] sync configs

<DFF> @@ -36,13 +36,18 @@ jobs:
               bin/ossy t c tmp/devtools/templates/$t $(basename $t .erb) project.yml
             done
           fi
-      - name: Merge configuration files from devtools
+      - name: Update workflow files from devtools
         run: |
           for f in `ls tmp/devtools/workflows/*.yml`
           do
             n="$(basename $f)";
             c=".github/workflows/custom/$n";
-            [ -f $c ] && bin/ossy c m $f $c .github/workflows/$n || echo "no custom config found for $f"
+
+            if [ -f $c ]; then
+              bin/ossy c m $f $c .github/workflows/$n
+            else
+              cp -v $f .github/workflows
+            fi
           done
       - name: Update configuration files from devtools
         run: |

{'addition_count': 7, 'commit_subject': '[devtools] sync configs', 'deletion_count': 2, 'file_extension': '.yml', 'lang': 'github/workflows/sync_configs', 'license': 'mit', 'repo_name': 'dry-rb/dry-monads'}