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

Update check-deps-versions.yml #245

Merged
merged 1 commit into from
Oct 15, 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
33 changes: 27 additions & 6 deletions .github/workflows/check-deps-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,33 @@ jobs:
with:
ref: ${{ matrix.branch }}

- name: Extract date
id: vars
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Set up Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Fetch all branches
run: git fetch --all

- name: Check if branch exists
id: check_branch
run: |
BRANCH_EXISTS=$(git ls-remote --heads origin pr@${{ matrix.branch }}@upgrade_client)
if [ -n "$BRANCH_EXISTS" ]; then
echo "Branch exists, checking it out."
echo "branch_exists=true" >> $GITHUB_ENV
else
echo "Branch does not exist, will create new one."
echo "branch_exists=false" >> $GITHUB_ENV
fi

- name: Checkout existing branch or create new one
run: |
if [ "$branch_exists" == "true" ]; then
git checkout pr@${{ matrix.branch }}@upgrade_client
else
git checkout -b pr@${{ matrix.branch }}@upgrade_client
fi

- name: Check client version
run: |
Expand Down Expand Up @@ -52,9 +76,6 @@ jobs:
- name: Update Client Version
if: env.need_update == '1'
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git checkout -b pr@${{ matrix.branch }}@upgrade_client_${DATE}
git add .
git commit -m "Update pkg versions"
git push origin