You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-09-12 04:51:50 +03:00
* Tighten GITHUB_TOKEN permissions Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Tighten GITHUB_TOKEN permissions Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix permission Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
85 lines
2.8 KiB
YAML
85 lines
2.8 KiB
YAML
# 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
|
|
concurrency: ${{ github.workflow }}
|
|
permissions: {} # Uses ELEMENT_BOT_TOKEN
|
|
jobs:
|
|
merge:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
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
|
|
|
|
- name: Get actions scripts
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: matrix-org/matrix-js-sdk
|
|
persist-credentials: false
|
|
path: .action-repo
|
|
sparse-checkout: |
|
|
scripts/release
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
cache: "yarn"
|
|
node-version-file: package.json
|
|
|
|
- name: Install Deps
|
|
run: "yarn 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
|
|
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..."
|
|
yarn 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
|