-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(.github) use GitHub CLI in PR flow
- Loading branch information
Showing
2 changed files
with
42 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,22 +32,45 @@ jobs: | |
src/**/*.php | ||
includes/**/*.php | ||
tests/**/*.php | ||
- name: Build v3.5 | ||
- name: Transpile to v3.5 | ||
run: | | ||
vendor/bin/rector process --config=config/rector-35.php -- ${{ steps.changed-files.outputs.files }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
base: "v3.5" | ||
token: ${{ secrets.V35_BUILD_TOKEN }} | ||
commit-message: "v3.5 automated build change" | ||
committer: "lucatume <[email protected]>" | ||
branch: "v3.5-automated-build" | ||
delete-branch: true | ||
title: "v3.5 automated build" | ||
body: "v3.5 automated build changes created by the v3.5 automated build workflow" | ||
assignees: "lucatume" | ||
add-paths: | | ||
includes/*.php | ||
src/*.php | ||
tests/*.php | ||
- name: Save changes to stash | ||
run: | | ||
git stash push --include-untracked -- 'src/*.php' 'includes/*.php' 'tests/*.php' | ||
- name: Reset HEAD | ||
run: | | ||
git reset HEAD --hard | ||
- name: Checkout v3.5 from origin | ||
run: | | ||
git fetch origin | ||
git checkout v3.5 | ||
git pull origin v3.5 | ||
- name: Create auto-build branch from v3.5, push to origin | ||
run: | | ||
git checkout -B v3.5-auto-build-from-v4 | ||
git push origin v3.5-auto-build-from-v4 | ||
- name: Checkout the changed files from the HEAD branch | ||
run: | | ||
git checkout ${{ github.sha }} -- 'src/*.php' 'includes/*.php' 'tests/*.php' | ||
- name: Pop changes from stash and commit them | ||
run: | | ||
git stash pop || true | ||
git add -- 'src/*.php' 'includes/*.php' 'tests/*.php' | ||
git commit -m "v3.5 auto-build from v4" | ||
- name: Push changes to v3.5-auto-build-from-v4 | ||
run: | | ||
git push origin v3.5-auto-build-from-v4 | ||
- name: Create Pull Request on v3.5 | ||
run: | | ||
gh pr create \ | ||
--base v3.5 \ | ||
--head-branch v3.5-auto-build-from-v4 \ | ||
--draft \ | ||
--assignee lucatume \ | ||
--title "v4 -> v3.5 auto-build" \ | ||
--body "v3.5 automated build changes from v4" \ | ||
--label "auto-build" \ | ||
--label "v3.5" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters