Skip to content

Commit

Permalink
fix: docker compose image tag workflow (#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKunalGupta authored Dec 4, 2024
1 parent 5c4d32e commit 1fd442c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/update-docker-compose-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: create-PR
shell: bash
run: |
set -eou pipefail
latest_tag="$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/releases/latest | jq '.tag_name')"
/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')"
sed -i -E 's|(image: ghcr\.io/peerdb\-io/.*?:stable-)(.*$)|\1'"${latest_tag}"'|g' docker-compose.yml
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git checkout -b "${PR_BRANCH}"
git fetch || true
git add -u
git commit -m 'chore(automated): upgrade docker-compose.yml stable tags'
git push -u origin "${PR_BRANCH}" --force-with-lease
PR_ID=$(gh pr list "${PR_LABEL}" --head "${PR_BRANCH}" --json number | jq -r '.[0].number // ""')
PR_ID=$(gh pr list --label "${PR_LABEL}" --head "${PR_BRANCH}" --json number | jq -r '.[0].number // ""')
if [ "$PR_ID" == "" ]; then
PR_ID=$(gh pr create -l "$PR_LABEL" -t "$PR_TITLE" --body "")
fi
git commit -m 'chore(automated): upgrade docker-compose.yml stable tags'
gh pr merge --auto --squash
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 1fd442c

Please sign in to comment.