Skip to content

Commit e3d9303

Browse files
committed
Use a dedicated workflow for each sync type
The approach inherited from the original Bash script-based approach to syncing the repository's file duplicates was to handle all syncing in a monolithic manner. As I convert this to a task-based aproach, I have decided that there really isn't enough in common between the types of files synced, nor their sync method, to justify combining them. Splitting them up allows for path filters on the workflow triggers and more meaningful results in the event of a failure.
1 parent 051bb95 commit e3d9303

File tree

3 files changed

+47
-42
lines changed

3 files changed

+47
-42
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This repository contains intentionally duplicated copies of template workflows under
2+
# workflow-templates/dependabot/workflow-template-copies used for Dependabot checks.
3+
#
4+
# This workflow checks that the copies are in sync.
5+
# If the workflow fails, run `task fix` and commit.
6+
7+
name: Check Workflow Duplicates Sync
8+
9+
on:
10+
push:
11+
paths:
12+
- ".github/workflows/check-dependabot-sync.ya?ml"
13+
- "Taskfile.yml"
14+
- "workflow-templates/*.ya?ml"
15+
- "workflow-templates/dependabot/workflow-template-copies/.github/workflows/*"
16+
pull_request:
17+
paths:
18+
- ".github/workflows/check-dependabot-sync.ya?ml"
19+
- "Taskfile.yml"
20+
- "workflow-templates/*.ya?ml"
21+
- "workflow-templates/dependabot/workflow-template-copies/.github/workflows/*"
22+
23+
jobs:
24+
check-sync:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v2
30+
31+
- name: Install Task
32+
uses: arduino/setup-task@v1
33+
with:
34+
repo-token: ${{ secrets.GITHUB_TOKEN }}
35+
version: 3.x
36+
37+
- name: Sync workflows
38+
run: task --silent dependabot:sync
39+
40+
- name: Check workflow duplicates sync
41+
run: |
42+
git add .
43+
if ! git diff --color --exit-code HEAD; then
44+
echo "::error::Workflow duplicates are out of sync. Please run \"task fix\""
45+
exit 1
46+
fi

.github/workflows/check-sync.yml

-41
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Check Configuration Files status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-configuration-files.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-configuration-files.yml)
44
[![Check License status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-license.yml)
5-
[![Check File Duplicates Sync status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-sync.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-sync.yml)
5+
[![Check Workflow Duplicates Sync status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-dependabot-sync.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-dependabot-sync.yml)
66

77
The [Arduino](https://www.arduino.cc/) Tooling Team's collection of reusable project infrastructure assets.
88

0 commit comments

Comments
 (0)