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

Add actionlint to prevent GHA workflow errors #463

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Conversation

jni
Copy link
Member

@jni jni commented Jul 22, 2024

This adds actionlint from napari/napari#7049 to help prevent errors in GHA workflows.

Update: @Czaki also fixed the errors found by actionlint and ensured that new docs builds from tags (a) end up in their own folder (rather than dev/), and (b) don't include alpha, beta and rc tags.

@jni
Copy link
Member Author

jni commented Jul 22, 2024

@Czaki, actionlint fails with errors in these lines:

run: |
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
echo "branch_name=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "branch_name=dev" >> $GITHUB_ENV
fi

.github/workflows/build_and_deploy.yml:109:9: shellcheck reported issue in this script: SC2193:warning:1:27: The arguments to this comparison can never be equal. Make sure your syntax is correct [shellcheck]

which explains why the deployment with 0.5.0 only happened in dev and didn't go into a folder. Do you have ideas on how to fix it?

@github-actions github-actions bot added the task label Jul 22, 2024
@jni jni requested a review from Czaki July 22, 2024 08:42
@jni jni added the maintenance CI, dependencies, and other maintenance label Jul 22, 2024
Comment on lines +112 to +120
TAG="${GITHUB_REF/refs\/tags\/v/}"
VER="${TAG/a*/}" # remove alpha identifier
VER="${VER/b*/}" # remove beta identifier
VER="${VER/rc*/}" # remove rc identifier

if [[ "$REF" == "refs/tags/v"* ]]; then
echo "branch_name=$VER" >> "$GITHUB_ENV"
else
echo "branch_name=dev" >> $GITHUB_ENV
echo "branch_name=dev" >> "$GITHUB_ENV"
Copy link
Contributor

@Czaki Czaki Jul 22, 2024

Choose a reason for hiding this comment

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

ealier code have 2 problems.

  • it will put v0.5.1 as version instead of 0.5.0
  • it will create folders for rc, alpha and beta.

I think that this code should work. We may test it by creating 0.5.1b1 and check if 0.5.0 is available (still may be not selectable from dropdown).

@jni jni added this to the 0.5.1 milestone Jul 22, 2024
@jni jni merged commit d850f16 into napari:main Jul 22, 2024
10 checks passed
@jni jni deleted the actionlint branch July 22, 2024 13:31
jni pushed a commit to napari/napari that referenced this pull request Jul 23, 2024
# References and relevant issues

Followup to napari/docs#463

# Description

It looks like the condition from napari/docs#463
was never triggered, as base workflow in repository was triggered only
by push to main branch, not on tag.
brisvag pushed a commit to brisvag/napari that referenced this pull request Jul 23, 2024
# References and relevant issues

Followup to napari/docs#463

# Description

It looks like the condition from napari/docs#463
was never triggered, as base workflow in repository was triggered only
by push to main branch, not on tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance CI, dependencies, and other maintenance task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants