Try passing the environment as a JSON string#51
Try passing the environment as a JSON string#51kevinbackhouse wants to merge 1 commit intoGitHubSecurityLab:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR attempts to refactor the GitHub Actions workflow for publishing to TestPyPI by moving the environment configuration from the job level to a reusable workflow parameter. The change removes the job-level runs-on and environment configuration and attempts to pass environment details as a JSON string parameter.
- Removes job-level
runs-onandenvironmentconfiguration from the publish job - Attempts to pass environment configuration as a JSON string to the reusable workflow
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| release_notes: ${{ github.head_ref }} | ||
| repository_url: https://test.pypi.org/legacy/ | ||
| environment: testpypi | ||
| environment: '{"name": "testpypi", "url": "https://test.pypi.org/p/seclab-taskflow-agent2"}' |
There was a problem hiding this comment.
The reusable workflow expects an input parameter named environment_name (not environment), and it should be a simple string value like 'testpypi', not a JSON object. The environment configuration with name and URL should be defined at the job level in this workflow, not passed as a parameter. Change this line to environment_name: testpypi and restore the job-level configuration that was removed.
| environment: '{"name": "testpypi", "url": "https://test.pypi.org/p/seclab-taskflow-agent2"}' | |
| environment_name: testpypi | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/seclab-taskflow-agent2 |
| environment: | ||
| name: testpypi | ||
| url: https://test.pypi.org/p/seclab-taskflow-agent2 | ||
| permissions: |
There was a problem hiding this comment.
The runs-on key is required for all jobs that don't call reusable workflows with uses. Since this job calls a reusable workflow, the runs-on should not be defined here (it's defined in the reusable workflow). However, the environment configuration that was removed should be restored at this job level, as it cannot be passed as a parameter to control deployment environments properly.
Trying to fix this error: