Skip to content

Commit e4497d1

Browse files
committed
add actionlint and fix GHA issues
1 parent ff86758 commit e4497d1

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

.github/workflows/bump-version.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
git config --local user.name "GitHub Action"
2020
git fetch --tags
2121
git pull origin master
22-
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
22+
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
2323
echo "latest tag: $latest_tag"
24-
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
24+
new_tag=$(echo "$latest_tag" | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
2525
echo "new tag: $new_tag"
2626
27-
printf "# pylint: disable=missing-module-docstring\n__version__ = \"$new_tag\"\n""" > $version_file
27+
printf "# pylint: disable=missing-module-docstring\n__version__ = \"%s\"\n""" "$new_tag" > $version_file
2828
2929
git commit -m "Bump to ${new_tag}" $version_file || echo "No changes to commit"
3030
git push origin

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ jobs:
7878
pip install policy_sentry -U
7979
git fetch origin
8080
git checkout --track origin/master
81-
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
81+
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
8282
echo "latest tag: $latest_tag"
83-
git pull origin $latest_tag
83+
git pull origin "$latest_tag"
8484
poet -f policy_sentry > HomebrewFormula/policy_sentry.rb
8585
git add .
8686
git commit -m "update brew formula" policy_sentry/bin/cli.py HomebrewFormula/policy_sentry.rb || echo "No brew changes to commit"
@@ -102,12 +102,12 @@ jobs:
102102
git config --local user.name "GitHub Action"
103103
git fetch --tags
104104
git pull origin master
105-
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
105+
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
106106
echo "latest tag: $latest_tag"
107-
new_tag=$(echo $latest_tag | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
107+
new_tag=$(echo "$latest_tag" | awk -F. -v a="$1" -v b="$2" -v c="$3" '{printf("%d.%d.%d", $1+a, $2+b , $3+1)}')
108108
echo "new tag: $new_tag"
109109
110-
printf "# pylint: disable=missing-module-docstring\n__version__ = '$new_tag'""" > $version_file
110+
printf "# pylint: disable=missing-module-docstring\n__version__ = '%s'""" "$new_tag" > $version_file
111111
112112
git commit -m "Bump to ${new_tag}" $version_file || echo "No changes to commit"
113113
git push origin

.github/workflows/python-dependency-updater.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
run: |
2222
pip install pyupio
2323
pip install -r requirements.txt
24-
default_branch=`git remote show origin | grep 'HEAD branch' | cut -d' ' -f5`
25-
pyup --provider github --provider_url https://api.github.com --repo=$GITHUB_REPOSITORY --user-token=${{ secrets.PYUP_GITHUB_ACCESS_TOKEN }} --branch $default_branch
24+
default_branch=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
25+
pyup --provider github --provider_url https://api.github.com --repo="$GITHUB_REPOSITORY" --user-token=${{ secrets.PYUP_GITHUB_ACCESS_TOKEN }} --branch "$default_branch"

.github/workflows/update.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ jobs:
1919
- name: install dependencies
2020
run: pip install requests schema PyYAML click click_log beautifulsoup4
2121
- name: install policy_sentry
22-
run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV
22+
run: echo "PYTHONPATH=$(pwd)" >> "$GITHUB_ENV"
2323
- name: Run initialize
2424
run: |
2525
python .github/scripts/update_data.py
2626
if [[ $(du -m /tmp/.policy_sentry/iam-definition.json | cut -f1) -lt 3 ]]; then
2727
echo "File size is less than 3 MB, something is wrong with this update"
2828
exit 1
2929
fi
30-
cp -f /tmp/.policy_sentry/iam-definition.json $(pwd)/policy_sentry/shared/data/iam-definition.json
31-
cp -rf /tmp/.policy_sentry/data/docs $(pwd)/policy_sentry/shared/data/
30+
cp -f /tmp/.policy_sentry/iam-definition.json "$(pwd)/policy_sentry/shared/data/iam-definition.json"
31+
cp -rf /tmp/.policy_sentry/data/docs "$(pwd)/policy_sentry/shared/data/"
3232
- name: Set outputs
3333
id: vars
3434
run: echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
repos:
2+
- repo: https://github.com/rhysd/actionlint
3+
rev: v1.6.26
4+
hooks:
5+
- id: actionlint-docker
26
- repo: https://github.com/antonbabenko/pre-commit-terraform
37
rev: v1.83.3
48
hooks:

0 commit comments

Comments
 (0)