Last modified by chrisby on 2025/04/22 14:54

From version 2.3
edited by chrisby
on 2025/04/22 14:13
Change comment: There is no comment for this version
To version 2.5
edited by chrisby
on 2025/04/22 14:33
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -34,9 +34,54 @@
34 34   git config --global url."https://${ACTIONS_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
35 35   go env -w GOPRIVATE=github.com/ocelot-cloud/*
36 36  
37 -### Private Go Repository Dependency
37 +This is a sample file how the weekly updates can be conducted via GitHub Actions. Create `.github/workflows/weekly-update.yml`:
38 38  
39 -If you are developing with Go and need a private repository as a dependency, you need to tell the SDK to use SSH instead of HTTPS to get access.
39 + name: Weekly Update
40 +
41 + on:
42 + schedule:
43 + - cron: '0 2 * * 3'
44 + workflow_dispatch:
45 +
46 + permissions:
47 + contents: write
48 + pull-requests: write
49 +
50 + jobs:
51 + weekly-update:
52 + runs-on: ubuntu-latest
53 + steps:
54 + - uses: actions/checkout@v4
55 +
56 + - uses: ./.github/actions/setup
57 +
58 + - name: Run ci-runner update
59 + run: |
60 + go get -u ./...
61 + go mod tidy
62 + go build
63 + # execute the test suite to check whether the updates did not break anything
64 +
65 + - name: Commit and create PR
66 + id: cpr
67 + uses: peter-evans/create-pull-request@v5
68 + with:
69 + commit-message: "chore: weekly ci-runner update"
70 + branch: weekly/ci-update
71 + title: "Weekly CI Runner Update"
72 + delete-branch: true
73 + token: ${{ secrets.GITHUB_TOKEN }}
74 +
75 + - name: Enable Auto-Merge
76 + if: steps.cpr.outputs.pull-request-operation == 'created'
77 + uses: peter-evans/enable-pull-request-automerge@v3
78 + with:
79 + pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
80 + merge-method: squash
40 40  
82 +### Git Configuration
83 +
84 +On your local PC, you need to tell the SDK to use SSH instead of HTTPS to get access.
85 +
41 41   git config --global url."ssh://git@github.com/".insteadOf "https://github.com/"
42 42   go env -w GOPRIVATE=github.com/ocelot-cloud/*