name: Update upstream release on: schedule: - cron: '0 3 * * *' workflow_dispatch: permissions: contents: write pull-requests: write concurrency: group: update-patchwork cancel-in-progress: true jobs: update: name: Bump to latest Patchwork release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Update pinned version run: ./update-version.sh - name: Check for changes id: changes run: | if git diff --quiet; then echo "No upstream changes." echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Open pull request if: steps.changes.outputs.changed == 'true' env: GH_TOKEN: ${{ github.token }} run: | set -euo pipefail source ./versions.sh BRANCH="update-patchwork-${APP_VERSION}" if git ls-remote --exit-code --heads origin "${BRANCH}" >/dev/null 2>&1; then echo "Branch ${BRANCH} already exists (a PR is probably open); nothing to do." exit 0 fi git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git checkout -b "${BRANCH}" git add versions.sh nz.scuttlebutt.Patchwork.yaml nz.scuttlebutt.Patchwork.metainfo.xml git commit -m "Update Patchwork to ${APP_VERSION}" git push -u origin "${BRANCH}" BODY=$(cat <