Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

env:
# Common versions
GO_VERSION: '1.23.4'
GO_VERSION: '1.23.6'
GOLANGCI_VERSION: 'v1.62.2'
DOCKER_BUILDX_VERSION: 'v0.11.2'

Expand All @@ -31,6 +31,7 @@ env:
# The package to push, without a version tag. The default matches GitHub. For
# example xpkg.upbound.io/crossplane/function-template-go.
XPKG: xpkg.upbound.io/${{ github.repository}}
CROSSPLANE_REGORG: ghcr.io/${{ github.repository}} # xpkg.crossplane.io/crossplane-contrib

# The package version to push. The default is 0.0.0-gitsha.
XPKG_VERSION: ${{ inputs.version }}
Expand Down Expand Up @@ -165,3 +166,14 @@ jobs:
- name: Push Multi-Platform Package to Upbound
if: env.XPKG_ACCESS_ID != ''
run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"

- name: Login to GHCR
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Multi-Platform Package to GHCR
if: env.XPKG_ACCESS_ID != ''

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just happened to be copying this PR for https://github.com/crossplane-contrib/function-python and wondered why it wasn't pushing to GHCR. It was because XPKG_ACCESS_ID wasn't set. Is there a reason to gate GHCR pushes on this environment variable? I can't think of one - the Upbound push gates on it because it's a required credential for that repo.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We realized the GHCR push process for the functions at the last minute, and we needed to act quickly on these PRs. I added this check without much thought to ensure that if it didn't push to the Upbound registry, it wouldn't push to GHCR either. I have no objection to its removal.

run: "./crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"
31 changes: 5 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
run:
timeout: 10m

skip-files:
- "zz_generated\\..+\\.go$"

output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
formats:
- format: colored-line-number

linters-settings:
errcheck:
Expand All @@ -18,15 +16,6 @@ linters-settings:
# default is false: such cases aren't reported by default.
check-blank: false

# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*

govet:
# report about shadowed variables
check-shadowing: false

gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
Expand All @@ -46,10 +35,6 @@ linters-settings:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10

maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true

dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
Expand All @@ -64,13 +49,6 @@ linters-settings:
# tab width in spaces. Default to 1.
tab-width: 1

unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false

unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
Expand Down Expand Up @@ -111,7 +89,6 @@ linters-settings:

linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
Expand Down Expand Up @@ -141,6 +118,8 @@ linters:


issues:
exclude-files:
- "zz_generated\\..+\\.go$"
# Excluding configuration per-path and per-linter
exclude-rules:
# Exclude some linters from running on tests files.
Expand Down Expand Up @@ -210,7 +189,7 @@ issues:
new: false

# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0
max-issues-per-linter: 0

# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/crossplane-contrib/function-patch-and-transform

go 1.23

toolchain go1.23.4
go 1.23.6

require (
github.com/alecthomas/kong v0.9.0
Expand Down