File tree 3 files changed +35
-17
lines changed
3 files changed +35
-17
lines changed Original file line number Diff line number Diff line change 4
4
# - Assets for the workflow templates used in this repository.
5
5
#
6
6
# This workflow checks that the copies are in sync.
7
- # If the workflow fails, run workflow-templates/etc/ sync.sh and commit.
7
+ # If the workflow fails, run `task dependabot: sync` and commit.
8
8
9
9
name : Check File Duplicates Sync
10
10
@@ -16,16 +16,26 @@ jobs:
16
16
check-sync :
17
17
runs-on : ubuntu-latest
18
18
19
+ env :
20
+ SYNC_COMMAND : task dependabot:sync
21
+
19
22
steps :
20
23
- name : Checkout repository
21
24
uses : actions/checkout@v2
22
25
26
+ - name : Install Task
27
+ uses : arduino/setup-task@v1
28
+ with :
29
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
30
+ version : 3.x
31
+
32
+ - name : Sync files
33
+ run : ${{ env.SYNC_COMMAND }} --silent
34
+
23
35
- name : Check file duplicates sync
24
36
run : |
25
- SYNC_SCRIPT_PATH="etc/sync.sh"
26
- "${{ github.workspace }}/$SYNC_SCRIPT_PATH"
27
37
git add .
28
38
if ! git diff --color --exit-code HEAD; then
29
- echo "::error::File duplicates are out of sync. Please run $SYNC_SCRIPT_PATH "
39
+ echo "::error::File duplicates are out of sync. Please run \"${{ env.SYNC_COMMAND }}\" "
30
40
exit 1
31
41
fi
Original file line number Diff line number Diff line change 1
1
version : " 3"
2
2
3
3
tasks :
4
+ fix :
5
+ desc : Make automated corrections to the project's files
6
+ deps :
7
+ - task : dependabot:sync
8
+
4
9
check :
5
10
desc : Check for problems with the project
6
11
deps :
7
12
- task : config:validate
8
13
14
+ dependabot:sync :
15
+ desc : Sync workflow duplicates for dependabot checks
16
+ vars :
17
+ WORKFLOW_TEMPLATES_PATH : " ./workflow-templates"
18
+ WORKFLOW_TEMPLATE_COPIES_PATH : " ./workflow-templates/dependabot/workflow-template-copies/.github/workflows"
19
+ cmds :
20
+ # Sync workflow templates with the copies in the folder where Dependabot can check them for updates.
21
+ - mkdir --parents "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"
22
+ - rm --force "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"/*
23
+ - |
24
+ find "{{.WORKFLOW_TEMPLATES_PATH}}" \
25
+ -maxdepth 1 \
26
+ -type f \
27
+ -regex '.*\.ya?ml' \
28
+ -exec cp '{}' "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}" \;
29
+
9
30
config:validate :
10
31
desc : Validate configuration files against their JSON schema
11
32
vars :
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments