RATYK-200 | Hashed action versions #50
Conversation
Pre-commit is already in common pipelines (in ci.yml) Refs: RATYK-200
Contains the release and pypi publish and uses the coh common workflow. Refs: RATYK-200
5fa530c to
d1feb4f
Compare
|
| ref: ${{ inputs.ref }} | ||
| # Run build job if a release was created or a ref was specified (i.e. workflow was invoked manually) | ||
| if: ${{ needs.release-please.outputs.release_created || inputs.ref }} |
There was a problem hiding this comment.
Bug: On automated triggers like push or schedule, inputs.ref is empty. If a release is created, this empty ref is passed to the reusable build workflow, likely causing it to fail.
Severity: HIGH
Suggested Fix
Provide a fallback value for the ref input to handle cases where inputs.ref is not available. A common and safe default is github.sha. The with block for the build job should be updated to ref: ${{ inputs.ref || github.sha }}.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: .github/workflows/publish.yml#L33-L35
Potential issue: The `build` job in the `publish.yml` workflow is triggered when a
release is created. On non-manual triggers such as `push` or `schedule`, the
`inputs.ref` context variable is empty. The workflow passes this empty `ref` to the
reusable `build-python-dists.yml` workflow. If the reusable workflow does not have a
defensive default for the `ref` input, the `actions/checkout` step within it will likely
fail because an empty string is not a valid branch, tag, or commit SHA. This would cause
automated releases triggered by pushes or schedules to fail.
Did we get this right? 👍 / 👎 to inform future reviews.
| if: ${{ needs.build.outputs.artifact_name }} | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/django-ilmoitin |
There was a problem hiding this comment.
this project needs to be switched to under city of helsinki first from the user helsinki



Refs: RATYK-200