From 7f415a9221eb2e101d53f4fa671d2bc2ea16ca4d Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 1 Nov 2023 10:33:42 -0700 Subject: [PATCH 1/3] Update README with section on updating existing repos to the latest workflow. --- README.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0cfc70a..91c65bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,20 @@ # Common CI workflows for OpenConfig Projects -## Standard Usage +## Upgrading CI Version + +When updating a repository to use the latest reusable CI workflow on the main +branch, `` should be used following the safest security and +stability recommendations: +https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow + +Do this by simply updating the SHA in the user repository's +`.github/workflows/go.yml` to the SHA of the current main branch. If you created +a PR to update the reusable workflow, then this will be available after the PR +is merged. + +## First-time Use + +### Standard Go Usage Copy the following into your repository's `.github/workflows/go.yml`: @@ -16,10 +30,10 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/go.yml@v1.0.0 + uses: openconfig/common-ci/.github/workflows/go.yml@ linter: - uses: openconfig/common-ci/.github/workflows/linter.yml@v1.0.0 + uses: openconfig/common-ci/.github/workflows/linter.yml@ ``` Then copy the sample linter configurations folder into your repository: @@ -31,7 +45,7 @@ cp -r common-ci/.github/linters YOUR-REPO/.github/linters At this point, you may wish to change the configuration of these linters to suit your own repository. -## Basic Usage +### Basic Go Usage (for simple Go repositories) If you do not want to maintain linter configuration, then you may use the basic workflow, which only involves copying the following into your repository's @@ -49,17 +63,17 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@v1.0.0 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@ ``` -## Flags +### Flags Some flags are supported for customizing the CI workflow, for example, ```yaml jobs: go: - uses: openconfig/common-ci/.github/workflows/basic_go.yml@v1.0.0 + uses: openconfig/common-ci/.github/workflows/basic_go.yml@ with: static-analysis-excludes-regex: exampleoc skip-gofmt: true From b41423094a03f5d6b128290e16ed3b708392367e Mon Sep 17 00:00:00 2001 From: wenovus Date: Wed, 1 Nov 2023 10:37:28 -0700 Subject: [PATCH 2/3] add example link --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 91c65bb..99720fc 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,10 @@ stability recommendations: https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow Do this by simply updating the SHA in the user repository's -`.github/workflows/go.yml` to the SHA of the current main branch. If you created -a PR to update the reusable workflow, then this will be available after the PR -is merged. +`.github/workflows/go.yml` to the SHA of the current main branch +([example](https://github.com/openconfig/kne/pull/371/files#diff-678682767f2477de3e3c546746f8568b9a1942b2c647d32331d7e774b8ff8d9f)). +If you created a PR to update the reusable workflow, then this will be available +after the PR is merged. ## First-time Use From 48c14c77419de594c40d297ee97702e939b05589 Mon Sep 17 00:00:00 2001 From: marcushines <80116818+marcushines@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:47:36 -0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99720fc..cbf349b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ When updating a repository to use the latest reusable CI workflow on the main branch, `` should be used following the safest security and stability recommendations: -https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow +[Stability Recommendations](https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow) Do this by simply updating the SHA in the user repository's `.github/workflows/go.yml` to the SHA of the current main branch