Sync k6 core dependencies #419
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: 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. |