Skip to content

Commit 8b20173

Browse files
committed
Update PHP 7.4 downgrade workflow and dependencies
- Enhanced GitHub Actions workflow to dynamically create or update `php7.4` branch from release tags. - Switched to `force-with-lease` for safer branch pushes. - Updated Composer dependencies to latest versions for compatibility.
1 parent a393e80 commit 8b20173

File tree

2 files changed

+145
-130
lines changed

2 files changed

+145
-130
lines changed

.github/workflows/downgrade-php74.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,20 @@ jobs:
5353
needs: verify-php82
5454
runs-on: ubuntu-latest
5555
steps:
56-
- name: Check out php7.4 branch
56+
- name: Check out repository
5757
uses: actions/checkout@v4
5858
with:
59-
ref: php7.4
6059
fetch-depth: 0
6160

61+
- name: Create/Switch to php7.4 branch from release tag
62+
run: |
63+
SRC_TAG="${{ github.event.release.tag_name }}"
64+
echo "Source tag: $SRC_TAG"
65+
# Ensure the tag exists locally (should be fetched by checkout with fetch-depth:0)
66+
git fetch --tags
67+
# Create or reset local branch php7.4 to the release tag commit
68+
git checkout -B php7.4 "$SRC_TAG"
69+
6270
- name: Setup PHP 8.2
6371
uses: shivammathur/setup-php@v2
6472
with:
@@ -106,7 +114,8 @@ jobs:
106114
env:
107115
NEW_TAG: ${{ steps.tag.outputs.new_tag }}
108116
run: |
109-
git push origin php7.4
117+
# Push the php7.4 branch (create or update). Use force-with-lease to update if it already exists.
118+
git push --force-with-lease origin php7.4
110119
# Create or move tag to latest commit on php7.4
111120
if git rev-parse "$NEW_TAG" >/dev/null 2>&1; then
112121
git tag -d "$NEW_TAG"

0 commit comments

Comments
 (0)