Skip to content

trigger-workflow

trigger-workflow #142

Workflow file for this run

name: Respond to linter trigger
on:
repository_dispatch:
types: [trigger-workflow]
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
if: github.repository == 'flathub/org.flatpak.Builder'
steps:
# 4.2.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
# 5.4.0
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38
with:
python-version: "3.13"
- name: Run update script
run: |
echo ${{ github.event.client_payload.sha }}
LINTER_SHA=${{ github.event.client_payload.sha }} python3 .github/scripts/rewrite-manfiest.py
- name: Sync linter deps file
run: |
LINTER_SHA=${{ github.event.client_payload.sha }}
TARGET_FILE="flatpak-builder-lint-deps.json"
TMP_FILE="$(mktemp)"
curl -fL \
"https://raw.githubusercontent.com/flathub-infra/flatpak-builder-lint/${LINTER_SHA}/docker/flatpak-builder-lint-deps.json" \
-o "$TMP_FILE"
mv -vf "$TMP_FILE" "$TARGET_FILE"
- name: Create pull request
if: ${{ success() }}
id: create-pr
# 7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
token: ${{ secrets.FP_BUILDER_FLATHUBBOT_TOKEN }}
branch-suffix: "random"
commit-message: |
(Automated) Bump linter
Bump linter to ${{ github.event.client_payload.sha }}
title: "(Automated) Bump linter"
body: |
Bump linter to ${{ github.event.client_payload.sha }}
delete-branch: true
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- name: Pause for a while
if: ${{ steps.create-pr.outputs.pull-request-number }}
run: sleep 200
- name: Set auto-merge
if: ${{ steps.create-pr.outputs.pull-request-number }}
run: gh pr merge --rebase --auto ${{ steps.create-pr.outputs.pull-request-number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}