Update dendrite #124
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update dendrite | |
on: | |
workflow_dispatch: | |
inputs: | |
reflector_access_token: | |
description: Access token for use in authenticating as the Reflector bot | |
type: string | |
reflector_user_id: | |
description: User id of the Reflector bot | |
type: string | |
permissions: | |
contents: write | |
pull-requests: write | |
# This is a workaround for the GitHub cli requiring excessive permissions when updating a pull | |
# request (https://github.com/cli/cli/discussions/5307) | |
repository-projects: read | |
jobs: | |
generate-update: | |
concurrency: | |
group: dendrite-integration | |
cancel-in-progress: true | |
runs-on: ubuntu-22.04 | |
env: | |
INT_BRANCH: dendrite-integration | |
TARGET_BRANCH: main | |
steps: | |
# Checkout both the target and integration branches | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
token: ${{ inputs.reflector_access_token }} | |
fetch-depth: 0 | |
- name: Update from main | |
run: | | |
. ./tools/reflector/helpers.sh | |
PATHS=("tools") | |
merge $TARGET_BRANCH $INT_BRANCH ${{ inputs.reflector_user_id }} "${PATHS[@]}" | |
- name: Update dendrite versions | |
run: | | |
./tools/update_dendrite.sh | |
- name: Extract new dendrite package version | |
run: | | |
eval $(cat tools/dendrite_openapi_version | grep COMMIT) | |
echo "version=${COMMIT:0:7}" >> $GITHUB_OUTPUT | |
id: updated | |
- name: Commit changes | |
run: | | |
. ./tools/reflector/helpers.sh | |
PATHS=("tools/dendrite_openapi_version") | |
CHANGES=() | |
commit $TARGET_BRANCH $INT_BRANCH ${{ inputs.reflector_user_id }} PATHS CHANGES | |
echo "api=${CHANGES[0]}" >> $GITHUB_OUTPUT | |
id: committed | |
- name: Update pull request | |
env: | |
GH_TOKEN: ${{ inputs.reflector_access_token }} | |
run: | | |
. ./tools/reflector/helpers.sh | |
TITLE="" | |
echo "" > body | |
if [ ${{ steps.committed.outputs.api }} ] | |
then | |
TITLE+=" dendrite to ${{ steps.updated.outputs.version }}" | |
echo "Updated dendrite to commit ${{ steps.updated.outputs.version }}." >> body | |
echo "" >> body | |
fi | |
TITLE="Update${TITLE}" | |
update_pr $TARGET_BRANCH $INT_BRANCH "$TITLE" "body" |