Skip to content

Commit f55616e

Browse files
authored
fix: cache licensed action (#422)
## Summary Automate license cache refreshes during the Licensed CI check. ## Details The Licensed workflow previously ran `licensed status` directly against the committed `.licenses` cache. Dependabot dependency bumps could fail when the cache was stale or missing records, even when the new dependency licenses were allowed. This updates the check job to run `licensed cache` before `licensed status`, so CI refreshes dependency records in the ephemeral checkout before enforcing the license policy. ## Expected behavior The Licensed workflow should now only fail when Licensed detects an invalid, missing, or disallowed license, not merely because committed cache records are stale.
1 parent 2df3f5f commit f55616e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/licensed.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# This workflow checks the statuses of cached dependencies used in this action
2-
# with the help of the Licensed tool. If any licenses are invalid or missing,
3-
# this workflow will fail. See: https://github.com/licensee/licensed
1+
# This workflow refreshes and checks dependency license records used in this
2+
# action with the help of the Licensed tool. If any licenses are invalid or
3+
# missing, this workflow will fail. See: https://github.com/licensee/licensed
44

55
name: Licensed
66

@@ -81,6 +81,11 @@ jobs:
8181
version: 4.x
8282
github_token: ${{ secrets.GITHUB_TOKEN }}
8383

84+
- name: Refresh License Cache
85+
id: refresh-license-cache
86+
if: steps.license-inputs.outputs.changed == 'true'
87+
run: licensed cache
88+
8489
- name: Check Licenses
8590
id: check-licenses
8691
if: steps.license-inputs.outputs.changed == 'true'

0 commit comments

Comments
 (0)