Skip to content

Commit ab458d1

Browse files
committed
audit workflows via zizmor and correct use of env variables
1 parent 4d22f78 commit ab458d1

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/create-translations-pr.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,37 @@ jobs:
2222
fetch-depth: 0 # Gets full github history.
2323
# Full history is needed for the scripted interactive rebase
2424
# which takes place in create_branch_for_language.sh below.
25+
persist-credentials: false
2526

2627
- name: Checkout scientific-python-translations automations
2728
uses: actions/checkout@v4
2829
with:
2930
repository: 'scientific-python-translations/automations'
3031
path: 'automations'
3132
ref: 'main'
33+
persist-credentials: false
3234

3335
- name: Create translations branch for language of interest
3436
env:
3537
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
LANG: ${{ github.event.inputs.language_code }}
3639
run: |
3740
git config --global user.email "actions@github.com"
3841
git config --global user.name "GitHub Actions"
39-
../automations/scripts/create_branch_for_language.sh origin main l10n_main ${{ github.event.inputs.language_code }}
42+
../automations/scripts/create_branch_for_language.sh origin main l10n_main "$LANG"
4043
branch_name=$(git rev-parse --abbrev-ref HEAD)
41-
git push -u origin $branch_name
44+
git push -u origin "$branch_name"
4245
echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV
4346
working-directory: ./numpy.org
4447

4548
- name: Create Pull Request
4649
env:
4750
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
52+
LANG: ${{ github.event.inputs.language_code }}
4853
run: |
49-
language_name=$(../automations/scripts/get_language_name.sh ${{ github.event.inputs.language_code }})
50-
gh pr create --base main --head ${{ env.BRANCH_NAME }} --title "Update translations for $language_name" \
54+
language_name=$(../automations/scripts/get_language_name.sh "$LANG")
55+
gh pr create --base main --head "$BRANCH_NAME" --title "Update translations for $language_name" \
5156
--body "This PR to update translations for $language_name was generated by the GitHub workflow, \
5257
auto-translations-pr.yml and includes all commits from this repo's Crowdin branch for the language \
5358
of interest. A final check of the rendered docs is needed to identify if there are any formatting \

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
26+
persist-credentials: false
2627
submodules: recursive
2728
fetch-depth: 0
2829

@@ -38,8 +39,8 @@ jobs:
3839
env:
3940
HUGO_VERSION: ${{ steps.hugo-version.outputs.HUGO_VERSION }}
4041
run: |
41-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
42-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
42+
wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
43+
&& sudo dpkg -i /tmp/hugo.deb
4344
4445
- name: Install Dart Sass
4546
env:

0 commit comments

Comments
 (0)