mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-01 21:53:42 +08:00
FrogPilot 0.9.7
This commit is contained in:
@@ -1,53 +1,44 @@
|
||||
name: "PR review"
|
||||
name: "PR Review"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, reopened, synchronize, edited, edited]
|
||||
types: [opened, reopened]
|
||||
|
||||
jobs:
|
||||
labeler:
|
||||
name: review
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
pr_check:
|
||||
name: Check PR Target Branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
fetch-depth: 0
|
||||
|
||||
# Label PRs
|
||||
- uses: actions/labeler@v5.0.0
|
||||
with:
|
||||
dot: true
|
||||
configuration-path: .github/labeler.yaml
|
||||
|
||||
# Check PR target branch
|
||||
- name: check branch
|
||||
uses: Vankka/pr-target-branch-action@def32ec9d93514138d6ac0132ee62e120a72aed5
|
||||
if: github.repository == 'commaai/openpilot'
|
||||
- name: Check Target Branch
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
target: /^(?!master$).*/
|
||||
exclude: /commaai:.*/
|
||||
change-to: ${{ github.base_ref }}
|
||||
already-exists-action: close_this
|
||||
already-exists-comment: "Your PR should be made against the `master` branch"
|
||||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
run: |
|
||||
TOKEN_USERNAME=$(gh api user -H "Authorization: token $GITHUB_TOKEN" --jq '.login')
|
||||
|
||||
# Welcome comment
|
||||
- name: comment
|
||||
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6
|
||||
if: github.event.pull_request.head.repo.full_name != 'commaai/openpilot'
|
||||
with:
|
||||
message: |
|
||||
<!-- _(run_id **${{ github.run_id }}**)_ -->
|
||||
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
|
||||
* Convert your PR to a draft unless it's ready to review
|
||||
* Read the [contributing docs](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md)
|
||||
* Before marking as "ready for review", ensure:
|
||||
* the goal is clearly stated in the description
|
||||
* all the tests are passing
|
||||
* the change is [something we merge](https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md#what-gets-merged)
|
||||
* include a route or your device' dongle ID if relevant
|
||||
comment_tag: run_id
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
if [[ "${{ github.actor }}" == "FrogAi" ]]; then
|
||||
echo "PR opened or reopened by FrogAi. No action needed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${{ github.base_ref }}" != "MAKE-PRS-HERE" ]]; then
|
||||
git config --global user.name "${{ github.actor }}"
|
||||
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
|
||||
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-f body="Please submit your pull request to the \"MAKE-PRS-HERE\" branch."
|
||||
|
||||
gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \
|
||||
-X PATCH -H "Authorization: token $GITHUB_TOKEN" -f state='closed'
|
||||
|
||||
exit 1
|
||||
else
|
||||
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-f body="Thank you for your PR! If you're not already in the FrogPilot Discord, [feel free to join](https://discord.FrogPilot.download) and let me know you've opened a PR!"
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
name: Update MAKE-PRS-HERE
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- FrogPilot-Staging
|
||||
|
||||
env:
|
||||
SOURCE_BRANCH: FrogPilot-Staging
|
||||
TARGET_BRANCH: MAKE-PRS-HERE
|
||||
|
||||
jobs:
|
||||
squash-and-cherry-pick:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ env.SOURCE_BRANCH }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set Git user name and email
|
||||
run: |
|
||||
git config --global user.name "${{ github.actor }}"
|
||||
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
|
||||
- name: Get the second to last commit hash and create a temporary branch
|
||||
run: |
|
||||
commit_hash=$(git rev-parse HEAD~1)
|
||||
git checkout -b temp-branch $commit_hash
|
||||
|
||||
- name: Squash all commits into one with today's date in Phoenix time zone
|
||||
run: |
|
||||
day=$(TZ='America/Phoenix' date '+%-d')
|
||||
suffix="th"
|
||||
case $day in
|
||||
1|21|31) suffix="st" ;;
|
||||
2|22) suffix="nd" ;;
|
||||
3|23) suffix="rd" ;;
|
||||
esac
|
||||
commit_message="$(TZ='America/Phoenix' date '+%B ')$day$suffix, $(TZ='America/Phoenix' date '+%Y') Update"
|
||||
git reset --soft $(git rev-list --max-parents=0 HEAD)
|
||||
git commit -m "$commit_message"
|
||||
|
||||
- name: Cherry-pick the squashed commit to target branch and push
|
||||
run: |
|
||||
git fetch origin
|
||||
git checkout ${{ env.TARGET_BRANCH }}
|
||||
git cherry-pick temp-branch -X theirs || {
|
||||
if git status | grep -q "nothing to commit, working tree clean"; then
|
||||
echo "Empty commit detected, skipping cherry-pick."
|
||||
git cherry-pick --skip
|
||||
else
|
||||
echo "Continuing with cherry-pick."
|
||||
git cherry-pick --continue
|
||||
fi
|
||||
}
|
||||
git push origin ${{ env.TARGET_BRANCH }}
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Update FrogPilot Branch
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update-branch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Reset "FrogPilot-Previous" branch to match "FrogPilot"
|
||||
run: |
|
||||
git fetch origin
|
||||
git checkout FrogPilot-Previous || git checkout -b FrogPilot-Previous
|
||||
git reset --hard origin/FrogPilot
|
||||
git push origin FrogPilot-Previous --force
|
||||
|
||||
- name: Reset "FrogPilot" branch to match "FrogPilot-Staging"
|
||||
run: |
|
||||
git fetch origin
|
||||
git checkout FrogPilot || git checkout -b FrogPilot
|
||||
git reset --hard origin/FrogPilot-Staging
|
||||
git push origin FrogPilot --force
|
||||
Reference in New Issue
Block a user