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

fix: github workflow vulnerable to script injection #2663

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Changes from 2 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
12 changes: 7 additions & 5 deletions .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
name: Hermetic library generation upon generation config change through pull requests
on:
pull_request:
paths:
- 'generation_config.yaml'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you put these lines back? They were added in 34e99b1

Copy link
Contributor

Choose a reason for hiding this comment

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

Restored


env:
HEAD_REF: ${{ github.head_ref }}
REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }}

jobs:
library_generation:
# skip pull requests coming from a forked repository
if: github.event.pull_request.head.repo.full_name == github.repository
if: github.env.REPO_FULL_NAME == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -32,11 +34,11 @@ jobs:
- name: Generate changed libraries
shell: bash
run: |
set -x
set -ex
[ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com"
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
bash .github/scripts/hermetic_library_generation.sh \
--target_branch ${{ github.base_ref }} \
--current_branch ${{ github.head_ref }}
--current_branch $HEAD_REF
env:
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
Loading