2024-05-30 12:34:34 +02:00
|
|
|
name: Update Playwright docker images
|
|
|
|
on:
|
|
|
|
workflow_dispatch: {}
|
|
|
|
schedule:
|
|
|
|
- cron: "0 6 * * *" # Every day at 6am UTC
|
|
|
|
jobs:
|
|
|
|
update:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-25 16:20:42 +02:00
|
|
|
- uses: actions/checkout@v4
|
2024-05-30 12:34:34 +02:00
|
|
|
|
2024-08-06 19:02:50 +02:00
|
|
|
- name: Update synapse image
|
2024-05-30 12:34:34 +02:00
|
|
|
run: |
|
|
|
|
docker pull "$IMAGE"
|
|
|
|
INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE")
|
|
|
|
DIGEST=${INSPECT#*@}
|
|
|
|
sed -i "s/const DOCKER_TAG.*/const DOCKER_TAG = \"develop@$DIGEST\";/" playwright/plugins/homeserver/synapse/index.ts
|
|
|
|
env:
|
2024-08-06 19:02:50 +02:00
|
|
|
IMAGE: ghcr.io/element-hq/synapse:develop
|
2024-05-30 12:34:34 +02:00
|
|
|
|
|
|
|
- name: Create Pull Request
|
|
|
|
id: cpr
|
2024-09-04 01:35:44 +02:00
|
|
|
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v7
|
2024-05-30 12:34:34 +02:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
branch: actions/playwright-image-updates
|
|
|
|
delete-branch: true
|
|
|
|
title: Playwright Docker image updates
|
|
|
|
labels: |
|
|
|
|
T-Task
|
|
|
|
|
|
|
|
- name: Enable automerge
|
|
|
|
run: gh pr merge --merge --auto "$PR_NUMBER"
|
|
|
|
if: steps.cpr.outputs.pull-request-operation == 'created'
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
|
|
|
|
|
|
|
|
- name: Enable autoapprove
|
|
|
|
run: |
|
|
|
|
gh pr review --approve "$PR_NUMBER"
|
|
|
|
if: steps.cpr.outputs.pull-request-operation == 'created'
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
|