Repository navigation
Read the latest release version for the Docker image tag with the workflow token - #265
Merged
vharseko merged 1 commit intoOct 28, 2026
Conversation
…kflow token An anonymous call to the releases API shares the rate limit of the runner's IP with other jobs. In run 39763486259 the answer held no "name", the version and the image tag came out empty, and build-push-action failed with "tag is needed when pushing to registry". Call the API through gh with GH_TOKEN, and fail the step itself when the call fails or the version is empty.
maximthomas
reviewed
Oct 27, 2026
maximthomas
left a comment
Contributor
There was a problem hiding this comment.
praise: The step now fails where the tag is lost, not two steps later in buildx.
git_version_last="$(gh api …)"has noexport(.github/workflows/build.yml:355,:457). The step's-etherefore sees gh's exit status, and a failed call stops the step with gh's own error line.test -n "$git_version_last"(:356,:458) stops an empty version before it reachesGITHUB_ENV.- Both jobs already hold
contents: read(:323-324,:425-426), soGH_TOKEN: ${{ github.token }}reads the release without a new permission.
maximthomas
self-requested a review
October 27, 2026 11:19
maximthomas
approved these changes
Oct 27, 2026
maximthomas
left a comment
Contributor
There was a problem hiding this comment.
See the comment above
vharseko
added a commit
that referenced
this pull request
Oct 28, 2026
… that its results no longer follow the default JDK of the runner image (#264) Fixes #263 ### Problem The java-kotlin job of the CodeQL workflow runs with `build-mode: none` and sets up no JDK. CodeQL infers no JDK from the project (`No specific JDK inferred from the project being analysed; using the java on the PATH`), so it models the JDK API on the default `java` of the runner image. On 2026-10-19 `ubuntu-latest` moved from ubuntu-24.04 to ubuntu-26.04, and that `java` changed from 17 to 25. Code scanning then opened alerts for APIs deprecated only after Java 17, the version the release is built with. The details are in #263. ### Fix - Before `Initialize CodeQL`, the java-kotlin job sets up the JDK that the release is built with, with the `actions/setup-java` parameters of `release.yml`: temurin, 8 on `sustaining/6.3.x` and 17 otherwise. The branch is taken from `github.base_ref` for a pull request and from `github.ref_name` for a push. The other languages do not use the step. The same change for OpenDJ is OpenIdentityPlatform/OpenDJ#1232. ### Test The change only takes effect in a CodeQL run, so the CodeQL run of this PR is the test. The java-kotlin job log must show `Java version: 17...` from `Eclipse Adoptium`, where master shows `Java version: 25.0.4.1`. A pull request analysis only reports results on the changed lines, so it cannot show the alerts going away. They are closed by the first analysis of master after the merge. ### Also in this PR: the OpenDJ wait of the usecase smoke tests The run of this PR failed all four `ui-smoke-tests (…, samples/usecase/usecase1)` legs with `OpenDJ did not start`. The cause has nothing to do with CodeQL. On 2026-10-21 `openidentityplatform/opendj:latest` moved to 5.2.0. Its `run.sh` no longer logs `OpenDJ is started`, the line the `Start OpenDJ for usecase samples` step waited for, although the server came up (`The Directory Server has started successfully`). Every usecase run fails the same way now, master included. The step now waits up to 5 minutes for the health status `healthy` of the container, the same check `build-docker` uses for the OpenIDM image. In 5.2.0 `healthy` means the bootstrap is complete (the LDIF is imported and the server is started again) and LDAPS answers. The 5 minutes match the `--start-period` of the image's `HEALTHCHECK`. Checked locally with `opendj:latest` (5.2.0) and the arguments of the workflow: the wait ends on `healthy`, and a bind as `cn=Directory Manager` on 1389 finds the 33 entries of `hr_data.ldif`. The failed `build-docker` of the same run (an empty image tag from an anonymous call to the releases API) is fixed separately in #265.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
build-dockerandbuild-docker-alpinejobs get the version for the image tag from an anonymouscurltoapi.github.com/repos/OpenIdentityPlatform/OpenIDM/releases/latest. In run 39763486259 of #264 the answer tobuild-dockerhad no"name". The step printedlast release:and still passed, the tag came out empty, andbuild-push-actionfailed withtag is needed when pushing to registry.build-docker-alpineof the same run got7.1.2.The step does not log the answer. The likely cause is the rate limit for anonymous API calls, which the runner's IP shares with other jobs. Two more weaknesses hid the failure:
export var="$(...)"returns the status ofexport, so a failed call cannot fail the step;Fix
In both jobs the
Get latest release versionstep:gh api ... --jq .namewithGH_TOKEN: ${{ github.token }}. The jobs already havecontents: read. An authenticated call has its own rate limit and does not share the runner's IP limit;export, so a failedghcall fails the step through-eand logs its error;test -nwhen the version is empty.Test
gh api repos/OpenIdentityPlatform/OpenIDM/releases/latest --jq .namereturns7.1.2, the same value the oldgrep/cutgave.build-dockerandbuild-docker-alpinemust printlast release: 7.1.2and build the image.