Skip to content

Commit

Permalink
Update docker-compose-pull.yml (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanedirt committed Jan 8, 2025
1 parent e236ba4 commit 6660cd2
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/docker-compose-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ jobs:
- name: Get repository and branch information
id: repo-info
run: |
echo "REPO_FULL_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
# Check if this is a PR from a fork
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.pull_request.head.repo.fork }}" = "true" ]; then
# If PR is from a fork, use main branch from lanedirt/AliasVault
echo "REPO_FULL_NAME=lanedirt/AliasVault" >> $GITHUB_ENV
echo "BRANCH_NAME=main" >> $GITHUB_ENV
else
# Otherwise use the current repository and branch
echo "REPO_FULL_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
echo "BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
fi
- name: Download install script from current branch
run: |
Expand All @@ -34,10 +42,23 @@ jobs:
echo "SMTP_PORT=2525" > .env
- name: Set permissions and run install.sh
id: install_script
continue-on-error: true
run: |
chmod +x install.sh
./install.sh install --verbose
- name: Check if failure was due to version mismatch
if: steps.install_script.outcome == 'failure'
run: |
if grep -q "Install script needs updating to match version" <<< "$(./install.sh install --verbose 2>&1)"; then
echo "Test skipped: Install script version is newer than latest release version. This is expected behavior if the install script is run on a branch that is ahead of the latest release."
exit 0
else
echo "Test failed due to an unexpected error"
exit 1
fi
- name: Set up Docker Compose
run: docker compose -f docker-compose.yml up -d

Expand Down

0 comments on commit 6660cd2

Please sign in to comment.