-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check and update dependencies in GitHub Actions action.yml #4178
Comments
This issue infers there is already partial support for dependency update for github-actions.. can you direct me to docs on that? |
This comment was marked as duplicate.
This comment was marked as duplicate.
Composite Actions follow a very similar structure to the "normal" GitHub Actions, with the exception that they must be located in a file called action.yml (or .yaml) in the root of the repository. Because of this similarity the file_parser and the file_updater does not need any tweaking, and it is only the file_fetcher that needs to be able to search beyond the .github/workflows folder. Since GitHub only looks for a single file in the root directory of the repository we can limit the expansion to the search to the same strict parameters so we don't accidentally find a lot of other stuff. Resolves dependabot#4178
@localheinz by the commits and closing of the issue, this seems to be done |
@georgettica composite actions (all actions I think) do not have to be in the root of the repository, and a repository may contain multiple actions. An action can be referenced like Composite actions in the same repo can also be referenced as local files, Does the given PR handle those? It seems to make assumptions about the location of the |
@georgettica Log: action.yml location is at root of repo: code snippet of dependabot.yml version: 2
updates:
- package-ecosystem: "github-actions" # search for actions - there are other options available
directory: "/" # search in .github/workflows under root `/` or action.yml at root
schedule:
interval: "daily" |
The change has not been released and rolled out yet, the issue was automatically closed because it was referenced by the commit, I'll reopen it for clarity. |
@jurre Thank you very much for clarification :) |
For subdirectories it doesn't work (tested today). But I found a workaround: version: 2
updates:
# Maintain dependencies for GitHub Actions (/.github/workflows)
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/actions/<my-custom-action-A>"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/actions/<my-custom-action-B>"
schedule:
interval: "daily" Dependabot has successfully scanned the files and created PRs. |
@fmeriaux should you open a card specific with you problem and your workaround? My guess is that by seeing the problem and your solution it can be solved at the source |
The current issue proposes to support composite actions. When the issue was created this was not the case, since the PR of @JonasAlfredsson they are supported if the action is at the root (of directory configuration). It is implied that nested composite actions are supported, but this is not the case. So I can open a "bug" in this sense, unless we stay on this issue that is not "solved" entirely. |
Hi @fmeriaux , I think not traversing into subdirectories is the intended usecase. I do not know if relevant documentation has been updated, but specifying each directory (where an action file is located) is necessary as it is written right now. While this is perhaps a little bit cumbersome if you have a lot of custom actions, I feel like this is a safer approach than just capturing every |
Yes, I agree with your reasoning. It may be more secure to have an explicit intention in the configuration. However the documentation is far from clear, I had to experiment and search in your contribution to understand and find a solution to my need. A good compromise could be to support wildcards, something like: version: 2
updates:
# Maintain dependencies for GitHub Actions (/.github/workflows)
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/actions/**"
schedule:
interval: "daily"
I can open a new issue for wildcard support, if you want. |
Two things:
|
Done #5137 |
Closing as the overall work has been merged / deployed in #4755 and #4815 and then the followup idea of not having to specify subdirectories is tracked in #5137. Many thanks to @JonasAlfredsson for all his hard work here. |
Here's my public repository trying to update dependencies directly in composite actions in sub-folders as supported by #4755 and can't get this to work. Can someone tell me if I am missing something / the feature isn't supported anymore? Issue: No PR's created against the actions in the subfolder by dependabot. |
This is so interesting because I just tried your case and it's indeed not working. But it seems that #6660 just merged has actually regressed this, so this should've been working for you until today. Could it by that your actions were up to date, and that's why no PRs were created? Anyways, I'll be fixing the regression now. |
@deivid-rodriguez Yes it seemed to work and create a PR. When I tried to rebase it dependabot closed the PR and is not generate any new ones and was unable to update dependencies in composite actions. The https://github.com/Scimia/public-shared-actions/blob/main/actions/security-actions/scan-docker-image/action.yaml has old versions of |
@saisatishkarra I just deployed the fix in #6690, can you try whether that works? |
@deivid-rodriguez Thanks for the release.
|
Regarding the first issue, I think it should be working. Can you try manually checking for updates at the "Insights > Dependency Graph > Dependabot" tab? Regarding the second problem, can you open a separate issue with steps to reproduce? Thanks! |
Manually triggering the checking for updates from the insights tab seemed to have worked and updated the PRs. I guess we can mark it resolved and dependable to automatically pick up any new updates later down the line. I have filed a bug previously for the second problem but this was supposed to be addressed from #6690 and #6660. I don't think this is still working. Appreciate someone taking a look and if I am missing something. Thanks again for the prompt response. |
Oh, sorry I missed that other issue you had opened. I will check that again and let you know exactly what to expect there. |
When using
composite
actions steps are defined inaction.yml
and we can have dependency to another actions.Currently dependencies aren't checked in
action.yml
The text was updated successfully, but these errors were encountered: