Skip to content

Commit efbe18c

Browse files
committed
Directly maintain template workflow dependencies via Dependabot
Dependabot supports managing GitHub Actions action dependencies of workflows. In addition to the workflows used in the repository's own infrastructure, this system was also used to maintain the dependencies of the "template" workflows. At the time it was set up, Dependabot had an inconvenient behavior where workflows were expected to be found in the `.github/workflows/` subfolder of the path specified via the `directory` key of the `dependabot.yml` configuration file. This meant it was not possible to directly scan the workflows in the `workflow-templates` folder. The workaround was to put a set of copies in `workflow-templates/dependabot/workflow-template-copies/.github/workflows/`. The Dependabot PRs proposing to update those workflows when an outdated action dependency was detected were not merged, but instead used as a notification of available updates for the source workflows in `workflow-templates`. A change in Dependabot in spring of 2022 caused the template maintenance system to stop working. That bug has been fixed. Along with the fix, the odd system of not looking for workflows in the folder specified via the `directory` key was dropped, which means it is now possible to use Dependabot to directly maintain the workflow templates, making the duplicates no longer necessary.
1 parent bfaf829 commit efbe18c

38 files changed

+6
-3822
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ updates:
1616

1717
# Configure check for outdated GitHub Actions actions in workflow templates.
1818
- package-ecosystem: github-actions
19-
# The workflows under the .github/workflows/ subfolder of this path will be checked.
20-
directory: /workflow-templates/dependabot/workflow-template-copies/
19+
directory: /workflow-templates/
2120
schedule:
2221
interval: daily
23-
commit-message:
24-
prefix: (DO NOT MERGE)
2522
labels:
2623
- "topic: infrastructure"
2724
assignees:

.github/workflows/check-dependabot-sync.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
[![Check npm status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-npm-task.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-npm-task.yml)
1111
[![Check General Formatting status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-general-formatting-task.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-general-formatting-task.yml)
1212
[![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)
13-
[![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)
1413
[![Check CI Workflows Sync status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-ci-sync.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-ci-sync.yml)
1514
[![Check Community Health Files Sync status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-community-health-sync.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-community-health-sync.yml)
1615
[![Check Configuration Files Sync status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-config-sync.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-config-sync.yml)

Taskfile.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ tasks:
4242
deps:
4343
- task: ci:sync
4444
- task: config:sync
45-
- task: dependabot:sync
4645
- task: general:correct-spelling
4746
- task: general:format-prettier
4847
- task: github:sync
@@ -371,22 +370,6 @@ tasks:
371370
-s "{{.SCHEMA_PATH}}" \
372371
-d "{{.PROJECT_FOLDER}}/{{.DATA_PATH}}"
373372
374-
dependabot:sync:
375-
desc: Sync workflow duplicates for dependabot checks
376-
vars:
377-
WORKFLOW_TEMPLATES_PATH: "./workflow-templates"
378-
WORKFLOW_TEMPLATE_COPIES_PATH: "./workflow-templates/dependabot/workflow-template-copies/.github/workflows"
379-
cmds:
380-
# Sync workflow templates with the copies in the folder where Dependabot can check them for updates.
381-
- mkdir --parents "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"
382-
- rm --force "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}"/*
383-
- |
384-
find "{{.WORKFLOW_TEMPLATES_PATH}}" \
385-
-maxdepth 1 \
386-
-type f \
387-
-regex '.*\.ya?ml' \
388-
-exec cp '{}' "{{.WORKFLOW_TEMPLATE_COPIES_PATH}}" \;
389-
390373
docs:generate:
391374
desc: Create all generated documentation content
392375
# This is an "umbrella" task used to call any documentation generation processes the project has.

workflow-templates/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Addition of, or requests for, any additional workflows that can be reusable betw
2323

2424
## Dependabot
2525

26-
Dependabot is used to check for outdated action versions used in the workflow templates. Details about that are [here](dependabot/README.md).
26+
Dependabot is used to [check for outdated action versions](https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot) used in the template workflows.
27+
28+
Dependabot's PRs will occasionally try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/bar@v2.3.4`). When the action author has [provided a major version ref](https://docs.github.com/actions/creating-actions/about-custom-actions#using-release-management-for-actions), use that instead (e.g., `uses: foo/bar@v2`). Once the major version has been updated in the workflow, Dependabot should not submit an update PR again until the next major version bump.
29+
30+
---
2731

2832
The same can be done for the workflows of any repository. See the instructions [here](assets/dependabot/README.md).

workflow-templates/dependabot/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

workflow-templates/dependabot/workflow-template-copies/.github/workflows/check-action-metadata-task.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

workflow-templates/dependabot/workflow-template-copies/.github/workflows/check-certificates.yml

Lines changed: 0 additions & 168 deletions
This file was deleted.

0 commit comments

Comments
 (0)