Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PRs in all depending repos #25

Merged
merged 7 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/setup-autoupdate-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Prepare meta update PR in autoupdate repo

runs:
using: "composite"
steps:
- name: Set up go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Run go generate
run: go generate ./...
13 changes: 0 additions & 13 deletions .github/workflows/announce-file-changes-template.md

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/create-issue-for-file-updates.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/create-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Create pull request in remote repository
on:
workflow_call:
inputs:
repository:
required: true
type: string
commit:
required: true
type: string
assignee:
required: true
type: string
setup-action:
type: string
secrets:
AUTOMATION_APP_ID:
required: true
AUTOMATION_APP_PRIVATE_KEY:
required: true

jobs:
workflow_call:
name: Create or update PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: OpenSlides/${{ inputs.repository }}
fetch-depth: 0
submodules: true

- name: Checkout meta repository commit
working-directory: .git/modules/openslides-meta/
run: git fetch origin && git checkout ${{ inputs.commit }}

- name: Update repository files
if: inputs.setup-action != ''
uses: jenseng/dynamic-uses@v1
with:
uses: ./.github/actions/${{ inputs.setup-action }}

- name: Generate access token
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.AUTOMATION_APP_ID }}
private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}

- name: Create or update PR
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
commit-message: Update meta repository
branch: dep/update-meta-repo
delete-branch: true
title: Update meta repository
body: "Triggered by commit [${{ inputs.commit }}](https://github.com/OpenSlides/openslides-meta/commit/${{ inputs.commit }})"
reviewers: ${{ inputs.assignee }}
assignees: ${{ inputs.assignee }}
labels: dependencies
milestone: 4
30 changes: 30 additions & 0 deletions .github/workflows/create-prs-for-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Create PRs on each update
on:
push:
branches:
- main

jobs:
create-pull-requests:
name: Create PR for autoupdate service
if: github.repository_owner == 'OpenSlides'
uses: ./.github/workflows/create-pr.yml
with:
repository: ${{ matrix.repository }}
commit: ${{ github.sha }}
assignee: ${{ matrix.assignee }}
setup-action: ${{ matrix.setup-action }}
secrets: inherit
strategy:
matrix:
include:
- repository: openslides-autoupdate-service
assignee: ostcar
setup-action: setup-autoupdate-pr
- repository: openslides-backend
assignee: jsangmeister
- repository: openslides-client
assignee: bastianjoel
- repository: openslides-search-service
assignee: bastianjoel