Skip to content
New issue

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

Download script downloads previous version #218

Closed
SnowCait opened this issue Sep 21, 2022 · 5 comments
Closed

Download script downloads previous version #218

SnowCait opened this issue Sep 21, 2022 · 5 comments

Comments

@SnowCait
Copy link
Contributor

I try to download v1.6.17 because actionlint was broken by #216 but v1.6.17 download script downloads v1.6.16.
(Go is not installed in my self-hosted runner, therefore I use download script.)

bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.6.17/scripts/download-actionlint.bash)

v1.6.17 is c9980ce.

This is caused by release workflow that rewrites download script version after tagged.
Download script version should be rewrited before tagged.

name: Release
on:
push:
tags:
- "v*.*.*"

- name: Update version in download script
run: |
set -x
ver="${GITHUB_REF#refs/tags/v}"
cd ./tmp-actionlint-for-update-ver
sed -i -E "s/version=\"[0-9]+\\.[0-9]+\\.[0-9]+\"/version=\"${ver}\"/" ./scripts/download-actionlint.bash
git diff
git add ./scripts/download-actionlint.bash
git -c user.email='41898282+github-actions[bot]@users.noreply.github.com' -c user.name='github-actions[bot]' commit -m "update version to $ver in download-actionlint.bash"
git log -n 1
git push

@SnowCait
Copy link
Contributor Author

It seems to be specifiable with arg but it's not documented and hard to understand because it shows both main and v1.6.17 versions.

if [ -n "$1" ]; then
if [[ "$1" != 'latest' && "$1" != 'LATEST' ]]; then
if [[ "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="$1"
else
echo "Given version '$1' does not match to regex '^[0-9]+\.[0-9]+\.[0-9]+$' nor equal to 'latest'" >&2
echo >&2
usage
exit 1
fi
fi
fi

@rhysd rhysd added bug Something isn't working and removed bug Something isn't working labels Sep 21, 2022
@rhysd
Copy link
Owner

rhysd commented Sep 21, 2022

You're misundesrstanding usage of the script. Give the version as command line option.

https://github.com/rhysd/actionlint/blob/main/scripts/download-actionlint.bash#L33

@rhysd rhysd closed this as completed Sep 21, 2022
@rhysd
Copy link
Owner

rhysd commented Sep 21, 2022

bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.17

is correct.

@SnowCait
Copy link
Contributor Author

SnowCait commented Sep 21, 2022

@rhysd

hard to understand because it shows both main and v1.6.17 versions.

My argument is this.
The current usage that fixes script version to main is not so good for me.

If you don't want to change usage, would you please document that in install.md?
It is difficult to find usage that is written in script.

@rhysd
Copy link
Owner

rhysd commented Sep 21, 2022

OK, I got your point. I can't change the script interface because it means a breaking change. I'll check document and update it as needed.

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

No branches or pull requests

2 participants