name: CI on: push: branches: [main] pull_request: permissions: contents: write pull-requests: write concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: check: name: Validate scripts and pinned versions runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Shell syntax check run: bash -n build.sh check-versions.sh update-version.sh versions.sh - name: Validate pinned versions run: ./check-versions.sh build: name: Build Flatpak runs-on: ubuntu-latest container: image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-24.08 options: --privileged steps: - uses: actions/checkout@v4 - name: Install Electron base app run: | flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install -y flathub org.electronjs.Electron2.BaseApp//24.08 - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: patchwork.flatpak manifest-path: nz.scuttlebutt.Patchwork.yaml verbose: true merge: name: Auto-merge update PR runs-on: ubuntu-latest needs: [check, build] if: | github.event_name == 'pull_request' && github.event.pull_request.state == 'open' && github.event.pull_request.user.login == 'github-actions[bot]' && contains(github.event.pull_request.labels.*.name, 'automerge') && (github.event.pull_request.mergeable_state == 'clean' || github.event.pull_request.mergeable_state == 'behind') env: GH_TOKEN: ${{ github.token }} steps: - name: Update branch if behind if: github.event.pull_request.mergeable_state == 'behind' run: gh pr update-branch "${{ github.event.pull_request.number }}" - name: Merge run: gh pr merge --squash --delete-branch "${{ github.event.pull_request.number }}"