Skip to content

RATYK-200 | Hashed action versions #50

Open
nicobav wants to merge 2 commits into
mainfrom
RATYK-200/gh-ci-changes
Open

RATYK-200 | Hashed action versions #50
nicobav wants to merge 2 commits into
mainfrom
RATYK-200/gh-ci-changes

Conversation

@nicobav

@nicobav nicobav commented May 11, 2026

Copy link
Copy Markdown
Contributor

Refs: RATYK-200

Pre-commit is already in common pipelines (in ci.yml)

Refs: RATYK-200
@nicobav nicobav requested a review from a team as a code owner May 11, 2026 06:46
Contains the release and pypi publish and uses the coh common
workflow.

Refs: RATYK-200
@nicobav nicobav force-pushed the RATYK-200/gh-ci-changes branch from 5fa530c to d1feb4f Compare May 27, 2026 04:19
@nicobav nicobav requested review from a team and voneiden May 27, 2026 04:19
@sonarqubecloud

Copy link
Copy Markdown

Comment on lines +33 to +35
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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this project needs to be switched to under city of helsinki first from the user helsinki

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

Successfully merging this pull request may close these issues.

2 participants