Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Feature/add zksolc version check (#217)
Browse files Browse the repository at this point in the history
* feat: add zksolc version check

* feat: add zksolc version check
  • Loading branch information
varex83 authored Oct 13, 2024
1 parent 48b7869 commit 71e47b9
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/check-zksolc-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ jobs:
id: check_pr_exists
if: env.update_required == 'true'
run: |
PR_EXIST=$(gh pr list --state=open --head update-zksolc-${{ env.ZKSOLC_VERSION }} | wc -l)
if [ "$PR_EXIST" -gt 0 ]; then
echo "PR already exists."
PR_URL=$(gh pr list --state=open --head update-zksolc-${{ env.ZKSOLC_VERSION }} --json url --jq '.[0].url')
if [ -n "$PR_URL" ]; then
echo "PR already exists: $PR_URL"
echo "pr_exists=true" >> $GITHUB_ENV
echo "PR_URL=${PR_URL}" >> $GITHUB_ENV
else
echo "No PR exists."
echo "pr_exists=false" >> $GITHUB_ENV
fi
- name: Check if branch already exists
id: check_branch_exists
if: env.update_required == 'true'
if: env.update_required == 'true' && env.pr_exists == 'false'
run: |
BRANCH_EXIST=$(git ls-remote --heads origin update-zksolc-${{ env.ZKSOLC_VERSION }} | wc -l)
if [ "$BRANCH_EXIST" -gt 0 ]; then
Expand Down Expand Up @@ -85,16 +86,23 @@ jobs:
run: |
git push origin update-zksolc-${{ env.ZKSOLC_VERSION }}
- name: Create Pull Request
if: env.update_required == 'true' && env.pr_exists == 'false'
- name: Create or Update Pull Request
if: env.update_required == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_URL=$(gh pr create \
--head update-zksolc-${{ env.ZKSOLC_VERSION }} \
--base develop \
--title "Update zksolc-bin to version ${{ env.ZKSOLC_VERSION }}" \
--body "A new version of zksolc-bin has been released: **${{ env.ZKSOLC_VERSION }}**.\nThis PR updates the project with the latest version." \
--label "zksolc,update" \
--assignee "varex83,stranger80")
PR_BODY="A new version of zksolc-bin has been released: **${{ env.ZKSOLC_VERSION }}**. This PR updates the project with the latest version."
if [ "${{ env.pr_exists }}" == "true" ]; then
gh pr edit "${{ env.PR_URL }}" --body "$PR_BODY"
echo "Updated existing PR: ${{ env.PR_URL }}"
else
PR_URL=$(gh pr create \
--head update-zksolc-${{ env.ZKSOLC_VERSION }} \
--base develop \
--title "Update zksolc-bin to version ${{ env.ZKSOLC_VERSION }}" \
--body "$PR_BODY" \
--label "zksolc,update" \
--assignee "varex83,stranger80")
echo "Created new PR: $PR_URL"
fi
echo "PR_URL=${PR_URL}" >> $GITHUB_ENV

0 comments on commit 71e47b9

Please sign in to comment.