1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

distros: PR writeback

This commit is contained in:
purian23
2025-12-12 23:02:52 -05:00
parent 66d22727e9
commit 38068e78c9
2 changed files with 85 additions and 30 deletions

View File

@@ -75,6 +75,9 @@ jobs:
name: Upload to PPA
needs: check-updates
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: |
github.event_name == 'workflow_dispatch' ||
needs.check-updates.outputs.has_updates == 'true'
@@ -84,6 +87,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
@@ -179,27 +183,52 @@ jobs:
bash distro/scripts/ppa-upload.sh "$PACKAGES" "$PPA_NAME" questing "${BUILD_ARGS[@]}"
fi
- name: Commit changelog updates
- name: Get changed packages
id: changed-packages
run: |
# Configure git user for commits
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Check if there are any changelog changes to commit
if git diff --exit-code distro/ubuntu/ >/dev/null 2>&1; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "📋 No changelog changes to commit"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
# Get list of changed packages for commit message
CHANGED=$(git diff --name-only distro/ubuntu/ | grep 'debian/changelog' | xargs dirname | xargs -I{} basename {} | tr '\n' ', ' | sed 's/,$//')
echo "📋 Committing changelog updates for: $CHANGED"
git add distro/ubuntu/
git commit -m "ci: Auto-update PPA packages [$CHANGED]" -m "🤖 Automated by GitHub Actions"
git push
CHANGED=$(git diff --name-only distro/ubuntu/ | grep 'debian/changelog' | xargs dirname | xargs -I{} basename {} | tr '\n' ',' | sed 's/,$//')
echo "packages=$CHANGED" >> $GITHUB_OUTPUT
echo "📋 Changed packages: $CHANGED"
fi
- name: Prepare PR body
if: steps.changed-packages.outputs.has_changes == 'true'
id: pr-body
run: |
{
echo 'body<<EOF'
echo '🤖 Automated by GitHub Actions'
echo ''
echo 'This PR updates Debian changelog files for PPA packages:'
echo "- **Packages**: ${{ steps.changed-packages.outputs.packages }}"
echo ''
echo 'Please review and merge to update the changelog files.'
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Create Pull Request
if: steps.changed-packages.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "ci: Auto-update PPA packages [${{ steps.changed-packages.outputs.packages }}]"
title: "ci: Auto-update PPA packages [${{ steps.changed-packages.outputs.packages }}]"
body: ${{ steps.pr-body.outputs.body }}
branch: ci/ppa-changelog-update
delete-branch: true
labels: |
automated
ci
path: |
distro/ubuntu/
- name: Summary
run: |
echo "### PPA Package Upload Complete" >> $GITHUB_STEP_SUMMARY