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

Improvement: support composite actions #116

Open
MPV opened this issue Oct 11, 2023 · 3 comments
Open

Improvement: support composite actions #116

MPV opened this issue Oct 11, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@MPV
Copy link

MPV commented Oct 11, 2023

Currently this action is hardcoded to only check workflow files:

const workflowsPath = process.env['ZG_WORKFLOWS_PATH'] || '.github/workflows';
const globber = await glob.create([workflowsPath + '/*.yaml', workflowsPath + '/*.yml'].join('\n'));

As "composite" actions can uses: other actions, it would be nice to be able to use this action on them too:

i.e. I'd like this to be caught by this action:

cat action.yml:

name: 'Hello World file creator action'
runs:
  using: "composite"
  steps:
    - uses: actions/checkout@v4 # <---
    - shell: bash
      run: echo "hello world" >> file.txt
@MPV
Copy link
Author

MPV commented Oct 11, 2023

While the path may be adjustable using ZG_WORKFLOWS_PATH, there's still a hardcoded *.ya?ml filename (which may include other files than my likely desired action.yml).

@MPV
Copy link
Author

MPV commented Oct 11, 2023

Can confirm it doesn't work (as it assumes "jobs" would be required):

Given you have a repo like this:

tree
.
└── my-action
    └── action.yml

2 directories, 1 file

Trying to run it like this:

- name: Ensure SHA pinned actions
  uses: zgosalvez/github-actions-ensure-sha-pinned-actions@f32435541e24cd6a4700a7f52bb2ec59e80603b1 # v2.1.4
  env:
    ZG_WORKFLOWS_PATH: '*'

...gives:

Run zgosalvez/github-actions-ensure-sha-pinned-actions@f32435541e24cd6a4700a7f52bb2ec59e80603b1
  env:
    ZG_WORKFLOWS_PATH: *
Error: The "action.yml" workflow does not contain jobs.
*/action.yml
  No issues were found.

@zgosalvez zgosalvez added the help wanted Extra attention is needed label Nov 1, 2023
@pfuhrmann
Copy link

We also wish this would work for composite actions. We have plenty of them and currently, with this action, they are not checked which largely defeats the purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants