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

GitHub Actions VSCode plugin warns context access is invalid with output example given in README.md #251

Open
johnseth97 opened this issue Sep 25, 2024 · 1 comment

Comments

@johnseth97
Copy link

johnseth97 commented Sep 25, 2024

The following code produces the above warning on lines 9 && 10

jobs:
    determine-changes:
        name: Determine Changes
        runs-on: ubuntu-latest
        permissions:
            pull-requests: read
            contents: read
        outputs:
            frontend: ${{ steps.changes.outputs.frontend }}
            backend: ${{ steps.changes.outputs.backend }}
        steps:
            - name: Checkout code
              uses: actions/checkout@v4
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}
            - name: Filter changed files
              id: changes
              uses: dorny/paths-filter@v3
              with:
                  filters: |
                      frontend:
                        - 'frontend/**'
                      backend:
                        - 'backend/**'

The following code, which essentially sets a default value, seems to fix it for me:

jobs:
    determine-changes:
        name: Determine Changes
        runs-on: ubuntu-latest
        permissions:
            pull-requests: read
            contents: read
        outputs:
            frontend: ${{ steps.changes.outputs.frontend || false }}
            backend: ${{ steps.changes.outputs.backend || false }}
        steps:
            - name: Checkout code
              uses: actions/checkout@v4
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}
            - name: Filter changed files
              id: changes
              uses: dorny/paths-filter@v3
              with:
                  filters: |
                      frontend:
                        - 'frontend/**'
                      backend:
                        - 'backend/**'
@amoralesc
Copy link

Sadly, the || true trick isn't working for me

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

2 participants