Skip to content

bug: when import env by file, maybe a bug #498

@dongjiang1989

Description

@dongjiang1989

When import env by file, maybe a bug.
ref: https://github.com/prometheus-operator/prometheus-operator/actions/runs/12581828916/job/35066326222

.github/workflows/checks.yaml:98:43: context "env" is not allowed here. no context is available here. see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details [expression]
   |
98 |           args: --timeout 10m0s --go '${{ env.golang-version }}'

action yaml:

  check-golang:
    runs-on: ubuntu-latest
    name: Golang linter
    steps:
      - uses: actions/checkout@v4
      - name: Import environment variables from file
        run: cat ".github/env" >> "$GITHUB_ENV"
      - uses: actions/setup-go@v5
        with:
          go-version: '${{ env.golang-version }}'
          check-latest: true
      - name: go.mod
        run: make tidy && git diff --exit-code
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v6.1.1
        with:
          version: v1.63.1
          args: --timeout 10m0s --go '${{ env.golang-version }}'

import env by file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions