I enabled the end-to-end tests CI job by configuring the relevant secret and environment variables. The job ran and actually indicated success but when I reviewed the log I noticed that all the tests were "skipped". I saw that the environment variable values are printed to the log. That gave a clue as to the problem: only the token was set, the others were unset. I think this is because the action pulls all the environment variables from github repo secrets. Only the access token is actually a secret. The other variables are defined as regular repository variables. Can you fix the yaml file accordingly?
{
"file_path": "/home/david/projects/stirlingbridge/machine/.github/workflows/build-release.yml"
} 1→name: Build and Release
2→
3→on:
4→ push:
5→ branches:
6→ - main
7→ - build-test
8→
9→jobs:
10→ publish:
11→ name: "Build and Release"
12→ runs-on: ubuntu-latest
13→ steps:
14→ - name: "Clone project repository"
15→ uses: actions/checkout@v4
16→ - name: "Install uv"
17→ uses: astral-sh/setup-uv@v4
18→ - name: "Install Python"
19→ run: uv python install 3.13
20→ - name: "Get release tag"
21→ id: release-tag
22→ run: |
23→ release_tag=$(./sh/make-release-tag.sh)
24→ echo "release-tag=v${release_tag}" >> $GITHUB_OUTPUT
25→ - name: "Build shiv package"
26→ run: |
27→ ./sh/build-package.sh
28→ - name: "Upload package as a github release"
29→ uses: softprops/action-gh-release@v2
30→ with:
31→ tag_name: ${{ steps.release-tag.outputs.release-tag }}
32→ draft: ${{ endsWith('build-test', github.ref ) }}
33→ files: ./build/machine
34→/home/david/projects/stirlingbridge/machine/.github/workflows/build-release.yml /home/david/projects/stirlingbridge/machine/.github/workflows/test.yml /home/david/projects/stirlingbridge/machine/.github/workflows/e2e-test.yml
{
"file_path": "/home/david/projects/stirlingbridge/machine/.github/workflows/e2e-test.yml"
} 1→name: E2E Test
2→
3→on:
4→ workflow_dispatch:
5→ schedule:
6→ # Run nightly at 06:00 UTC
7→ - cron: "0 6 * * *"
8→
9→jobs:
10→ e2e:
11→ name: "End-to-End Tests"
12→ runs-on: ubuntu-latest
13→ environment: e2e
14→ steps:
15→ - name: "Clone project repository"
16→ uses: actions/checkout@v4
17→ - name: "Install uv"
18→ uses: astral-sh/setup-uv@v4
19→ - name: "Install Python"
20→ run: uv python install 3.13
21→ - name: "Install dependencies"
22→ run: uv sync
23→ - name: "Run E2E tests"
24→ env:
25→ E2E_DO_TOKEN: ${{ secrets.E2E_DO_TOKEN }}
26→ E2E_SSH_KEY: ${{ secrets.E2E_SSH_KEY }}
27→ E2E_DNS_ZONE: ${{ secrets.E2E_DNS_ZONE }}
28→ run: uv run pytest tests/test_e2e.py -v -m e2e
29→The issue is clear — E2E_SSH_KEY and E2E_DNS_ZONE are pulled from secrets.* but they're actually regular repository variables, not secrets. They should use vars.* instead.
E2E_DO_TOKEN: ${{ secrets.E2E_DO_TOKEN }}
E2E_SSH_KEY: ${{ secrets.E2E_SSH_KEY }}
E2E_DNS_ZONE: ${{ secrets.E2E_DNS_ZONE }} E2E_DO_TOKEN: ${{ secrets.E2E_DO_TOKEN }}
E2E_SSH_KEY: ${{ vars.E2E_SSH_KEY }}
E2E_DNS_ZONE: ${{ vars.E2E_DNS_ZONE }}The file /home/david/projects/stirlingbridge/machine/.github/workflows/e2e-test.yml has been updated successfully.
Changed E2E_SSH_KEY and E2E_DNS_ZONE from secrets.* to vars.*. The token stays as a secret since it's the only actual sensitive value. This also explains why those two were empty in the logs — secrets values are masked, but since they weren't found in secrets they resolved to empty strings, while vars values would have been printed (and populated).
Thanks. I also noticed that this code doesn't handle the E2E_PROJECT variable. It was added later so perhaps was missed.
{
"pattern": "E2E_PROJECT",
"path": "/home/david/projects/stirlingbridge/machine/tests/test_e2e.py",
"output_mode": "content"
}12: E2E_PROJECT - DO project name to assign droplets to
38:E2E_PROJECT = os.environ.get("E2E_PROJECT")
49:if not E2E_PROJECT:
50: _MISSING.append("E2E_PROJECT")
79: cfg["project"] = E2E_PROJECTIt's used the same way as the others and is also not a secret. I'll add it as a vars.* reference.
E2E_DO_TOKEN: ${{ secrets.E2E_DO_TOKEN }}
E2E_SSH_KEY: ${{ vars.E2E_SSH_KEY }}
E2E_DNS_ZONE: ${{ vars.E2E_DNS_ZONE }} E2E_DO_TOKEN: ${{ secrets.E2E_DO_TOKEN }}
E2E_SSH_KEY: ${{ vars.E2E_SSH_KEY }}
E2E_DNS_ZONE: ${{ vars.E2E_DNS_ZONE }}
E2E_PROJECT: ${{ vars.E2E_PROJECT }}The file /home/david/projects/stirlingbridge/machine/.github/workflows/e2e-test.yml has been updated successfully.
Added E2E_PROJECT: ${{ vars.E2E_PROJECT }} to the env block. You'll need to make sure E2E_PROJECT is defined as a repository variable in GitHub as well.
You're welcome! Don't forget to set E2E_PROJECT as a repository variable in GitHub before the next run.