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 some postgres submodule check issues #6717

Merged
merged 2 commits into from
Jan 20, 2024
Merged
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
7 changes: 4 additions & 3 deletions .github/workflows/pull-request-meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pull Request Meta

on:
pull_request:
types: [opened, edited, synchronize, labeled, closed]
types: [opened, edited, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
Expand All @@ -19,12 +19,13 @@ jobs:
submodules: false

- name: Verify that postgres/ was not changed unintentionally
env:
PR_TITLE: ${{ github.event.pull_request.title }}
shell: bash
run: |
required_prefix="Update bundled PostgreSQL"

title="${{ github.event.pull_request.title }}"
if [[ $title == $required_prefix* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohhh, this was not quoted so it was being interpreted as commands. Strange that it didn't happen before with my PR titles.

I shouldn't have done this in bash.

Copy link
Member Author

Choose a reason for hiding this comment

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

The quoting around $title was my first suspicion as well, but that wasn't really it. It not being quoted means it will be expanded as multiple arguments to [[, which might be fine, though I quoted it to be safe.

The big issue was that backquotes are evaluated inside of double quotes, so when I had a PR title with backquotes in it, it got executed.
Fix was to pass it in as an env var.

if [[ "$PR_TITLE" == $required_prefix* ]]; then
exit 0
fi

Expand Down
Loading