-
Notifications
You must be signed in to change notification settings - Fork 8
38 lines (33 loc) · 1.08 KB
/
sync-core-deps.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Sync k6 core dependencies
on:
schedule:
- cron: 3 14 * * * # Every day at 3:14
workflow_dispatch: {}
jobs:
sync-k6-deps:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write # Push branch.
pull-requests: write # Create PR.
env:
GH_TOKEN: ${{ github.token }}
BRANCH_NAME: ci-sync-deps
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Sync dependencies
run: |
git checkout -b "$BRANCH_NAME"
./hack/depsync.sh
if [[ -z "$(git status --porcelain --untracked-files=no)" ]]; then
echo "Nothing to do"
exit 0
fi
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git commit -am "go.mod: sync dependencies with k6 core"
git push -f -u origin "$BRANCH_NAME"
gh pr create --fill --body-file depsync-pr-body.txt || true # It is okay to fail if a PR already exists.