Repository navigation
Fix: keep target action references on sync - #9
Conversation
| directories: | ||
| - "/" | ||
| - "/sync/files" | ||
| - "/sync/files-public" |
There was a problem hiding this comment.
I'm not 100% sure, but it looks like Dependabot may not pick up the workflows in /sync/files and /sync/files-public with the current configuration, worth double checking.
From what I read in dependabot-core, the github-actions file fetcher only looks into .github/workflows when the configured directory is exactly /. For any other directory, it seems to list the YAML files directly inside that directory (workflows_dir = "."), without descending into .github/workflows:
https://github.com/dependabot/dependabot-core/blob/cbabeb7b1671021a093ac3990c9e0ac17dc20fdd/github_actions/lib/dependabot/github_actions/file_fetcher.rb#L162-L182
If that reading is correct, /sync/files and /sync/files-public only contain a .github folder at their root, so Dependabot would find no workflow there, and the pinned references in the synced files would never be updated (which the README now states they are).
If confirmed, pointing the entries at the workflow folders themselves should work:
directories:
- "/"
- "/sync/files/.github/workflows"
- "/sync/files-public/.github/workflows"| match($0, /uses: "[^"@]+@/) { | ||
| action = substr($0, RSTART, RLENGTH) | ||
| if (FNR == NR) { pins[action] = substr($0, RSTART + RLENGTH); next } | ||
| if (action in pins) { $0 = substr($0, 1, RSTART + RLENGTH - 1) pins[action] } |
There was a problem hiding this comment.
a reference already present in a target always wins, even when the template is bumped on purpose, worth double checking.
If so, the backport-action v5.0.0 bump of this PR would not reach the targets that already have forward-port.yml: they would stay on v4.7.0 until their own Dependabot proposes v5. The same would apply to a future @v1 to @v2 move of the reusable glpi-project/* workflows. And if a later template change needs an input that only exists in the new version, targets would get the new inputs with the old action.
Synced files overwrote the action references of target repositories, so Dependabot pull requests opened there conflicted with the sync pull request or were reverted by it. The sync now keeps the references already set in each target file, letting the target Dependabot manage them on every branch. References set here only apply to targets missing the action; this repository's Dependabot now scans sync/files and sync/files-public to keep them up to date. Also bumps korthout/backport-action to v5.0.0 in the forward-port workflow.