Skip to content

"Context access might be invalid: <outputs>" showed up for 'dorny/paths-filter' GitHub Action #305

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

Open
hwhsu1231 opened this issue Mar 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@hwhsu1231
Copy link

hwhsu1231 commented Mar 11, 2024

Describe the bug

I found that the outputs of dorny/paths-filter@v3 cannot be accessed with the following warning messages:

Context access might be invalid: cmake

However, the outputs of tibdex/github-app-token@v2 can be accessed without the above warning messages.

See the screenshots of these two in Screenshots.

For the records, although the warning messages showed up, the outputs of dorny/paths-filter@v3 were printed correctly.

To Reproduce

Copy and paste the following two code snippets:

Click to expand demo of 'paths-filter'
      - name: Filter Changes in the Pull Request
        id: filter
        uses: dorny/paths-filter@v3
        with:
          list-files: 'json'
          filters: |
            cmake:
              - 'cmake/**/*.cmake'
              - 'CMakeLists.txt'
              - 'CMakePresets.json'
            document:
              - 'docs/ACKNOWLEDGEMENTS.md'
              - 'docs/CONTRIBUTING.md'
              - 'docs/MAINTAINING.md'
              - 'CODE_OF_CONDUCT.md'
              - 'README.md'
            workflow:
              - '.github/workflows/*.yml'
              - '.github/workflows/*.yaml'

      - name: Check Outputs of paths-filter
        run: |
          echo "steps.filter.outputs.cmake    = ${{ steps.filter.outputs.cmake }}"
          echo "steps.filter.outputs.document = ${{ steps.filter.outputs.document }}"
          echo "steps.filter.outputs.workflow = ${{ steps.filter.outputs.workflow }}"
          echo "steps.filter.outputs.cmake_count    = ${{ steps.filter.outputs.cmake_count }}"
          echo "steps.filter.outputs.document_count = ${{ steps.filter.outputs.document_count }}"
          echo "steps.filter.outputs.workflow_count = ${{ steps.filter.outputs.workflow_count }}"
          echo "steps.filter.outputs.cmake_files    = ${{ steps.filter.outputs.cmake_files }}"
          echo "steps.filter.outputs.document_files = ${{ steps.filter.outputs.document_files }}"
          echo "steps.filter.outputs.workflow_files = ${{ steps.filter.outputs.workflow_files }}"
Click to expand demo of 'github-app-token'
      - name: Get the GitHub App's Token
        uses: tibdex/github-app-token@v2
        id: ggat
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}

      - name: Checkout to '${{ github.ref }}'
        uses: actions/checkout@v4
        with:
          ref: ${{ github.ref }}
          token: ${{ steps.ggat.outputs.token }}
          submodules: true

Expected behavior

The warning messages shouldn't show up.

Screenshots

Screenshot_20240311_110340
image
Screenshot_20240311_124644

Extension Version

v0.26.2

Additional context

@RedbeanGit
Copy link

RedbeanGit commented Aug 5, 2024

It looks like the only output defined in the action.yml file of the dorny/paths-filter@v3 action is changes:

outputs:
  changes:
    description: JSON array with names of all filters matching any of changed files

Maybe this action should find another way to generate dynamic outputs.

@PaulRBerg
Copy link

I'm not a VSCode expert but I don't think there's any way for any GitHub Actions to dynamically generate outputs. The only solution is to let users of this VSCode extensions to silence warnings:

#222

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
Status: Backlog 🗒
Development

No branches or pull requests

3 participants