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
8 changes: 8 additions & 0 deletions .github/workflows/check-versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ jobs:
with:
persist-credentials: false

# Security: Checkout the trusted version.sh from main branch to prevent script injection
- if: startsWith(github.event_name, 'pull_request')
name: Checkout version.sh from main branch
run: |
git fetch origin main
git checkout origin/main -- version.sh
chmod +x version.sh

# Only run version check for PRs. If PR does NOT have "same version" label, then ensure that
# version.txt is different from what is in main.
- if: startsWith(github.event_name, 'pull_request') && !contains(github.event.pull_request.labels.*.name, 'same version')
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/update-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
})

build:
if: ${{ github.event.issue.pull_request }} && contains(github.event.comment.body, '/version')
if: github.event.issue.pull_request && contains(github.event.comment.body, '/version') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest

steps:
Expand All @@ -57,7 +57,14 @@ jobs:
with:
repository: ${{ fromJSON(steps.get-pr.outputs.result).head.repo.full_name }}
ref: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}


# Security: Checkout the trusted version.sh from main branch to prevent script injection
- name: Checkout version.sh from main branch
run: |
git fetch origin main
git checkout origin/main -- version.sh
chmod +x version.sh

- name: Update version minor
if: contains(github.event.comment.body, '/version minor')
run: |
Expand Down
Loading