We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
up to now the latest version of podman-compose is deduced using octokit:
podman-compose
octokit
async function findLatestVersion(): Promise<string> { const octokit = new Octokit() const response = await octokit.repos.getLatestRelease({ owner: 'docker', repo: 'compose' }) return response.data.tag_name }
which requires GITHUB_TOKEN. This complicates things a bit when testing GitHub actions using act.
GITHUB_TOKEN
act
Today I just noticed that if the latest keyword is appended to https://github.com/docker/compose/releases/ then GitHub redirects to the latest version, e.g. https://github.com/docker/compose/releases/latest become https://github.com/docker/compose/releases/tag/v2.21.0 (at the time of writing this post) from which v2.21.0 can be easily extracted. In words of curl:
latest
v2.21.0
curl
$ curl -Ls -o /dev/null -w '%{url_effective}\n' 'https://github.com/docker/compose/releases/latest' https://github.com/docker/compose/releases/tag/v2.21.0
Its also possible to fetch the latest release anonymously:
$ curl -L https://api.github.com/repos/docker/compose/releases/latest { "url": "https://api.github.com/repos/docker/compose/releases/119350941", "assets_url": "https://api.github.com/repos/docker/compose/releases/119350941/assets", "upload_url": "https://uploads.github.com/repos/docker/compose/releases/119350941/assets{?name,label}", "html_url": "https://github.com/docker/compose/releases/tag/v2.21.0", "id": 119350941, "author": { "login": "github-actions[bot]", "id": 41898282, .... }
To be honest I have no idea why octokit needs GITHUB_TOKEN for this case.
The text was updated successfully, but these errors were encountered:
The workaround:
jobs: tests: steps: - name: Determine the latest version of docker-compose id: vars run: | LATEST=$(curl -Ls -o /dev/null -w '%{url_effective}' 'https://github.com/docker/compose/releases/latest') echo "docker_compose_latest=${LATEST##*/}" >> $GITHUB_OUTPUT - uses: KengoTODA/actions-setup-docker-compose@v1 with: version: '${{ steps.vars.outputs.docker_compose_latest }}'
Please feel free to close this if you don't wish to implement the feature.
Sorry, something went wrong.
No branches or pull requests
Hello,
up to now the latest version of
podman-compose
is deduced usingoctokit
:which requires
GITHUB_TOKEN
. This complicates things a bit when testing GitHub actions usingact
.Today I just noticed that if the
latest
keyword is appended to https://github.com/docker/compose/releases/ then GitHub redirects to the latest version, e.g. https://github.com/docker/compose/releases/latest become https://github.com/docker/compose/releases/tag/v2.21.0 (at the time of writing this post) from whichv2.21.0
can be easily extracted. In words ofcurl
:Its also possible to fetch the latest release anonymously:
To be honest I have no idea why
octokit
needsGITHUB_TOKEN
for this case.The text was updated successfully, but these errors were encountered: