# Gitflow merge-back master->develop name: Merge master -> develop on: push: branches: [master] workflow_call: secrets: ELEMENT_BOT_TOKEN: required: true inputs: dependencies: description: List of dependencies to reset. type: string required: false dir: description: The directory to release type: string default: "." concurrency: ${{ github.workflow }} permissions: {} # Uses ELEMENT_BOT_TOKEN jobs: merge: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: # We will be pushing to this branch and want the CI to run after we do so we cannot use the GITHUB_TOKEN token: ${{ secrets.ELEMENT_BOT_TOKEN }} fetch-depth: 0 persist-credentials: true - name: Get actions scripts uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: repository: matrix-org/matrix-js-sdk persist-credentials: false path: .action-repo sparse-checkout: | scripts/release - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 with: cache: "pnpm" node-version-file: package.json - name: Install Deps run: "pnpm install --frozen-lockfile" - name: Set up git run: | git config --global user.email "releases@riot.im" git config --global user.name "RiotRobot" - name: Merge to develop run: | git checkout develop git merge -X ours master - name: Reset dependencies if: inputs.dependencies working-directory: ${{ inputs.dir }} run: | while IFS= read -r PACKAGE; do [ -z "$PACKAGE" ] && continue CURRENT_VERSION=$(cat package.json | jq -r .dependencies[\"$PACKAGE\"]) echo "Current $PACKAGE version is $CURRENT_VERSION" if [[ "$CURRENT_VERSION" == "null" ]] then echo "Unable to find $PACKAGE in package.json" exit 1 fi if [[ "$CURRENT_VERSION" == *"#develop" ]] then echo "Not updating dependency $PACKAGE" continue fi echo "Resetting $PACKAGE to develop branch..." pnpm add "github:matrix-org/$PACKAGE#develop" git add -u git commit -m "Reset $PACKAGE back to develop branch" done <<< "$DEPENDENCIES" env: DEPENDENCIES: ${{ inputs.dependencies }} - name: Push changes run: git push origin develop