Skip to content

Commit

Permalink
hato-botのCIを反映するよ!
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 10, 2024
1 parent 800b01a commit c64159c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ jobs:
- name: Install dependencies
run: bash "${GITHUB_WORKSPACE}/scripts/pr_test/pr_super_lint/npm_ci.sh"
- name: Lint files
uses: super-linter/super-linter/slim@v5.7.2
uses: super-linter/super-linter/slim@v6.0.0
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_SQLFLUFF: false
VALIDATE_CHECKOV: false # TODO: checkovが依存するopenaiのバージョンがアップデートされたら削除
LINTER_RULES_PATH: .
FILTER_REGEX_EXCLUDE: ".*assets/.*.txt"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
WORKON_HOME: ""
PYTHONPATH: ${{ env.PYTHONPATH }}
pr-dotenv-linter:
Expand Down
24 changes: 12 additions & 12 deletions scripts/pr_format/pr_format/install_pipenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ file_name=Dockerfile
package_name=pipenv

if [ -f ${file_name} ]; then
PATTERN="${package_name}[^ ]+"
package_name_with_version=$(grep -oE "${PATTERN}" ${file_name})
PATTERN="${package_name}[^ ]+"
package_name_with_version=$(grep -oE "${PATTERN}" ${file_name})
else
package_name_with_version=${package_name}
package_name_with_version=${package_name}
fi

pip install "${package_name_with_version}"

if [ -f ${file_name} ]; then
new_version="$(pip list --outdated | grep pipenv || true)"
new_version="$(echo -e "${new_version}" | awk '{print $3}')"
if [ -n "${new_version}" ]; then
PATTERN_BEFORE="${package_name}[^ ]+"
PATTERN_AFTER="${package_name}==${new_version}"
sed -i -E "s/${PATTERN_BEFORE}/${PATTERN_AFTER}/g" ${file_name}
pip install "${package_name}==${new_version}"
exit 1
fi
new_version="$(pip list --outdated | grep pipenv || true)"
new_version="$(echo -e "${new_version}" | awk '{print $3}')"
if [ -n "${new_version}" ]; then
PATTERN_BEFORE="${package_name}[^ ]+"
PATTERN_AFTER="${package_name}==${new_version}"
sed -i -E "s/${PATTERN_BEFORE}/${PATTERN_AFTER}/g" ${file_name}
pip install "${package_name}==${new_version}"
exit 1
fi
fi
4 changes: 2 additions & 2 deletions scripts/pr_test/pr_super_lint/install_pipenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ file_name=Dockerfile
package_name=pipenv

if [ -f ${file_name} ]; then
package_name_v=$(grep -oE "${package_name}[^ ]+" ${file_name})
package_name_v=$(grep -oE "${package_name}[^ ]+" ${file_name})
else
package_name_v=${package_name}
package_name_v=${package_name}
fi

pip install "${package_name_v}"
Expand Down
4 changes: 2 additions & 2 deletions scripts/pr_test/pr_super_lint/npm_ci.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

bash "${GITHUB_WORKSPACE}/scripts/npm_ci.sh"
echo "PYTHONPATH=/github/workspace/:/github/workflow/.venv/lib/python$(echo 'import sys; print(".".join(map(str, sys.version_info[0:2])))' | python)/site-packages" >> "${GITHUB_ENV}"
echo "PYTHONPATH=/github/workspace/:/github/workflow/.venv/lib/python$(echo 'import sys; print(".".join(map(str, sys.version_info[0:2])))' | python)/site-packages" >>"${GITHUB_ENV}"
action="$(yq '.jobs.pr-super-lint.steps[-1].uses' .github/workflows/pr-test.yml)"
PATH="$(docker run --rm --entrypoint '' "ghcr.io/${action//\/slim@/:slim-}" /bin/sh -c 'echo $PATH')"
echo "PATH=/github/workspace/node_modules/.bin:${PATH}" >> "$GITHUB_ENV"
echo "PATH=/github/workspace/node_modules/.bin:${PATH}" >>"$GITHUB_ENV"

0 comments on commit c64159c

Please sign in to comment.