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

DAT-18283 DevOps :: Homebrew failure #232

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
with:
ruby-version: 3.1.4

- name: Install GitHub CLI
run: sudo apt-get update && sudo apt-get install gh -y

jandroav marked this conversation as resolved.
Show resolved Hide resolved
- name: Get Reusable Files
run: |
# Under the src folder is where specific packages files live. The GitHub action inputs will modify the universal package-deb-pom.xml to tell the process which assets to use during the packaging step
Expand Down Expand Up @@ -130,7 +133,28 @@ jobs:
mv ${{ inputs.artifactId }}-${{ inputs.version }}-1.noarch* $PWD/yum/noarch
aws s3 sync $PWD/yum s3://repo.liquibase.com/yum


- name: Check for existing Homebrew formula PR for ${{ inputs.artifactId }}
id: check-brew-pr
run: |
# Authenticate GitHub CLI
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token

# Define the PR title
pr_title="liquibase ${{ inputs.version }}"

# Search for open pull requests with the specified title in the Homebrew/homebrew-core repo
pr_exists=$(gh pr list --repo Homebrew/homebrew-core --state open --search "$pr_title" --json title --jq ".[] | select(.title == \"$pr_title\") | .title" || true)
echo "pr_exists: $pr_exists"
# Set the environment variable based on whether the PR exists
if [ -n "$pr_exists" ]; then
echo "PR_EXISTS=true" >> $GITHUB_ENV
else
echo "PR_EXISTS=false" >> $GITHUB_ENV
fi

- name: Update Homebrew formula for ${{ inputs.artifactId }}
if: env.PR_EXISTS == 'false'
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: liquibase
Expand Down