Skip to content
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

Determine best way to include composite actions #919

Open
onedr0p opened this issue Dec 2, 2023 · 5 comments
Open

Determine best way to include composite actions #919

onedr0p opened this issue Dec 2, 2023 · 5 comments

Comments

@onedr0p
Copy link
Owner

onedr0p commented Dec 2, 2023

Currently we use hardcoded repo paths onedr0p/containers/.github/workflows/simple-checks.yaml@main in certian steps, it would be great to figure out how to make that more generic for people who are forking this repo and want to build their own containers.

@br3ndonland
Copy link

The easiest thing to do would be to change the reusable workflow references to local reusable workflows. It looks like you're already using local references for the render-readme workflow.

render-readme:
name: Render Readme
needs: build-images
if: ${{ always() && needs.build-images.result != 'failure' }}
uses: ./.github/workflows/render-readme.yaml
secrets: inherit

Happy to get you a PR to update the other ones if it's helpful.

Composite actions are a bit different. You'd have to convert the reusable workflows to action.yml files, and they have a bunch of quirks and restrictions (like this). In general I'd recommend sticking with reusable workflows instead of composite actions.

Thanks for maintaining this project. Lots of useful container images.

@onedr0p
Copy link
Owner Author

onedr0p commented Apr 21, 2024

There was an issue with using local reusable workflows and I honestly can't recall what it was, maybe @JJGadgets or @bjw-s remember 😄

@onedr0p
Copy link
Owner Author

onedr0p commented Apr 21, 2024

I found the previous discussion on it here

#918 (comment)

@br3ndonland
Copy link

I found the previous discussion on it here

#918 (comment)

I don't agree with that comment. PRs can always run "with a modified version of the workflow." Any other PR could make the same change shown in #918 (comment) and Actions would run that change. I don't think the uses: key is really the primary security measure. Other security measures available for PRs:

@bjw-s
Copy link
Collaborator

bjw-s commented Apr 23, 2024

Any other PR could make the same change shown in #918 (comment) and Actions would run that change.

At the time that we were building this workflow system, I believe we tested this and it would ever only run the workflow contents from the main branch even if the PR specified something else, making this the "easiest" way to do this at the time. Of course insights evolve and we should iterate on / revisit previous results so if there are better ways to do these things today we should definitely take a look at them (when time permits)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants