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

Reusable workflow secrets/inputs/outputs should be case-insensitive #216

Closed
jorgellanos91 opened this issue Sep 19, 2022 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@jorgellanos91
Copy link

When I call a reusable workflow with a secret in the new version of the action (v1.6.18) it fails with

secret is not defined in reusable workflows error.

.github/workflows/job.yml:17:11: secret “SECRET" is required by "./.github/workflows/reusable-job.yml" reusable workflow [workflow-call]
   |
17 |     uses: ./.github/workflows/reusable-job.yml
   |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.github/workflows/jobyml:21:7: secret “secret" is not defined in "./.github/workflows/reusable-job.yml" reusable workflow. defined secret is “SECRET" [workflow-call]

But when I call it I pass the secrets and still fail.

If I force the workflow to use the previous version (v1.6.17) without any other change then it succeeds.

Maybe it's related to the relative path of the reusable workflow.

@selfagency
Copy link

i'm having this issue as well with the latest version across all my workflows

@mariusfilipowski
Copy link

Same for me. It looks like the name of the secrets is expected in lower case although they are (as defined) in upper case.

@rhysd
Copy link
Owner

rhysd commented Sep 20, 2022

Could someone provide minimal reusable workflow and caller workflow? Then I'll try to check what is going wrong.

It seems a problem of case-insensitivity.

@rhysd rhysd added the bug Something isn't working label Sep 20, 2022
@rhysd
Copy link
Owner

rhysd commented Sep 20, 2022

I could reproduce this:

reusable.yaml:

on:
  workflow_call:
    secrets:
      SECRET:
        required: true

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: ...

test.yaml:

on: push

jobs:
  test:
    uses: ./reusable.yaml
    secrets:
      secret: test

Errors reported:

test.yaml:5:11: secret "SECRET" is required by "./reusable.yaml" reusable workflow [workflow-call]
  |
5 |     uses: ./reusable.yaml
  |           ^~~~~~~~~~~~~~~
test.yaml:7:7: secret "secret" is not defined in "./reusable.yaml" reusable workflow. defined secret is "SECRET" [workflow-call]
  |
7 |       secret: test
  |       ^~~~~~~

@rhysd
Copy link
Owner

rhysd commented Sep 20, 2022

I think inputs also has the same issue though it is smaller issue since inputs are usually in lower case.

@rhysd rhysd changed the title Reusable workflow secrets false positive Reusable workflow secrets/inputs/outputs should be case-insensitive Sep 21, 2022
@rhysd
Copy link
Owner

rhysd commented Sep 21, 2022

I fixed this issue at 6713f82 but this issue will be closed when more regression tests are added and the branch is merged into main.

@rhysd rhysd closed this as completed in 0ffabf9 Sep 22, 2022
@rhysd
Copy link
Owner

rhysd commented Sep 22, 2022

v1.6.19 was released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants