Skip to content

Basic fix to allow for reusable workflows.#22

Closed
hanleym wants to merge 1 commit intonialov:masterfrom
Calamu-Technologies:master
Closed

Basic fix to allow for reusable workflows.#22
hanleym wants to merge 1 commit intonialov:masterfrom
Calamu-Technologies:master

Conversation

@hanleym
Copy link
Contributor

@hanleym hanleym commented Oct 22, 2025

Currently, steps defaults to [] (unhelpful) and runs-on is always set. This prevents using reusable workflows where job has a uses attribute instead of steps. (GitHub doesn't allow both to be set.) This fix allows steps to be null (not in the final yaml) and runs-on is only set if steps is set.

@nialov
Copy link
Owner

nialov commented Oct 27, 2025

Thanks for the PR! Can you

  1. git rebase -i origin/master && git push --force-with-lease. I changed the GitHub action config on master to run on pull requests.
  2. Run nix develop -c pre-commit run --all-files. There was one file that nixfmt-rfc-style changes.
➜ nix flake check
warning: unknown flake output 'self'
warning: unknown flake output 'actions-nix'
trace: Obsolete option `defaults' is used. It was renamed to `defaultValues'.
error: builder for '/nix/store/29kbsshc751fxw50yj969v8f1hff4ak1-pre-commit-run.drv' failed with exit code 1;
       last 25 log lines:
       > no configure script, doing nothing
       > Running phase: buildPhase
       > Running: $ pre-commit run --all-files
       > deadnix..................................................................Passed
       > nixfmt-rfc-style.........................................................Failed
       > - hook id: nixfmt-rfc-style
       > - files were modified by this hook
       > render-workflows.........................................................Passed
       > statix...................................................................Passed
       > trim-trailing-whitespace.................................................Passed
       > diff --git a/nix/flake-modules/actions-nix/ci.nix b/nix/flake-modules/actions-nix/ci.nix
       > index 49fa923..c0971b4 100644
       > --- a/nix/flake-modules/actions-nix/ci.nix
       > +++ b/nix/flake-modules/actions-nix/ci.nix
       > @@ -27,7 +27,9 @@ let
       >        };
       >      };
       >    };
       > -  jobModule = { config, ... }: {
       > +  jobModule =
       > +    { config, ... }:
       > +    {
       >        freeformType = lib.types.attrs;
       >        options = {
       >          runs-on = mkEmptyDescriptionOption {
       For full logs, run:
         nix log /nix/store/29kbsshc751fxw50yj969v8f1hff4ak1-pre-commit-run.drv

Will merge after these!

@nialov
Copy link
Owner

nialov commented Oct 27, 2025

I am also interested in an example repository where you use this if you have one public? I do not think I have used jobs.<job_id>.uses myself previously (even though code minimization is my goal 😄 ).

@nialov
Copy link
Owner

nialov commented Dec 8, 2025

Merged in #29

@nialov nialov closed this Dec 8, 2025
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

Successfully merging this pull request may close these issues.

2 participants