Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Actionlint
# https://github.com/rhysd/actionlint

on:
pull_request:
paths:
- '.github/workflows/**'

permissions: {}

jobs:
actionlint:
name: Action lint
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check workflow files
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -ignore SC2129

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this the proper way to do it? bash+curl?

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.

curl is printing downloaded file to stdout.

<(command) redirect command output to stdout of command

It is equivalent of: curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry I wasn't clear; I know that's what's happening :P I mean in terms of security, isn't this generally frowned upon? Are we ok with doing it in our workflow? Pointing to a main, unversioned?

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.

It is working this way in the napari main repo.

Code also has no permissions.

It will be better to pin the version, but we need an automatic bumper then. And I do not have any idea how to do this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ok. Let's get this in like this then for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it is fine with permissions = {} and no credentials persisted.

In the future, this may be a cleaner way to avoid bash execution. The risk as is is likely minimal.

        env:
          ACTIONLINT_VERSION: 1.7.12
        run: |
          curl --fail --silent --show-error --location \
            "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" \
            | tar xz actionlint
          ./actionlint -color -ignore SC2129

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.

I'm not sure if we will remember to bump the version

shell: bash
1 change: 0 additions & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
target_directory:
description: 'The directory to deploy the docs to'
required: true
default: 'dev'
type: string
napari_ref:
description: 'The napari/napari ref to build the docs against'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/remove_ready_to_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
description: 'The name of the label to remove from closed items'
required: false
default: 'ready to merge'
type: string

permissions:
pull-requests: write
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/upload_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ jobs:
# if src exists, add it to the pathmap
if [ -d "src" ]; then
echo " src/" >> ci_coveragerc
echo " D:\\a\\$REPO_NAME\\$REPO_NAME\\src" >> ci_coveragerc
printf '%s\n' " D:\\a\\$REPO_NAME\\$REPO_NAME\\src" >> ci_coveragerc
echo " /home/runner/work/$REPO_NAME/$REPO_NAME/src" >> ci_coveragerc
echo " /Users/runner/work/$REPO_NAME/$REPO_NAME/src" >> ci_coveragerc
else
echo " ${GITHUB_WORKSPACE}" >> ci_coveragerc
echo " D:\\a\\$REPO_NAME\\$REPO_NAME" >> ci_coveragerc
printf '%s\n' " D:\\a\\$REPO_NAME\\$REPO_NAME" >> ci_coveragerc
echo " /home/runner/work/$REPO_NAME/$REPO_NAME" >> ci_coveragerc
echo " /Users/runner/work/$REPO_NAME/$REPO_NAME" >> ci_coveragerc
fi
Expand All @@ -72,7 +72,7 @@ jobs:
python -Im coverage combine --rcfile=ci_coveragerc covreports
python -Im coverage xml -o coverage.xml
python -Im coverage report
python -Im coverage report --format=markdown --skip-empty --skip-covered >> $GITHUB_STEP_SUMMARY
python -Im coverage report --format=markdown --skip-empty --skip-covered >> "$GITHUB_STEP_SUMMARY"

- name: Upload to codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
Expand Down
Loading