Skip to content

Commit

Permalink
chore(readme): add simple script to update workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny authored Nov 30, 2023
1 parent 22654fd commit 5376c35
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,35 @@ For each template, you can propagate them on all the repos that use it.
![image](https://raw.githubusercontent.com/nextcloud/.github/master/screenshots/dispatch-a-workflow.png)

4. Wait for the actions to finish and see the checkout the pull requests

## Update workflows with a script

You can also run the following shell script on your machine to update all workflows of an app. It should be run inside the cloned repository of an app and requires rsync to be installed.

Do not forget to check the diff for unwanted changes before committing!

```sh
#!/bin/sh

# Update GitHub workflows from the Nextcloud template repository.
# This script is meant to be run from the root of the repository.

# Sanity check
[ ! -d ./.github/workflows/ ] && echo "Error: .github/workflows does not exist" && exit 1

# Clone template repository
temp="$(mktemp -d)"
git clone --depth=1 https://github.com/nextcloud/.github.git "$temp"

# Update workflows
rsync -vr \
--existing \
--include='*/' \
--include='*.yml' \
--exclude='*' \
"$temp/workflow-templates/" \
./.github/workflows/

# Cleanup
rm -rf "$temp"
```

0 comments on commit 5376c35

Please sign in to comment.