Skip to content

Commit 76c4f00

Browse files
Kidswissgithub-actions[bot]
authored andcommitted
chore: accept new Cruft update
1 parent cf1e975 commit 76c4f00

File tree

6 files changed

+65
-106
lines changed

6 files changed

+65
-106
lines changed

.cruft.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/vshn/appcat-cookiecutter",
3-
"commit": "5309ae05edb3c118e23e64e8ec0bed2b6768ac86",
3+
"commit": "74c103e846f9a9496bf9fd1856bb3376f0da3e4c",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -13,7 +13,8 @@
1313
".github/workflows/cruft-update.yml",
1414
".github/changelog-configuration.json"
1515
],
16-
"_template": "https://github.com/vshn/appcat-cookiecutter"
16+
"_template": "https://github.com/vshn/appcat-cookiecutter",
17+
"_commit": "74c103e846f9a9496bf9fd1856bb3376f0da3e4c"
1718
}
1819
},
1920
"directory": null

.github/changelog-configuration.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@
3232
]
3333
}
3434
],
35-
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}"
35+
"template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}",
36+
"ignore_labels": [
37+
"ignoreChangelog"
38+
]
3639
}

.github/workflows/pr.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,31 @@ env:
1616
PUSH_IMAGE: "True"
1717

1818
jobs:
19+
check-allow-merge:
20+
runs-on: ubuntu-latest
21+
steps:
22+
# Labels in the context don't get updated so they are stuck at what's set during creation
23+
# We need this action to get current labels
24+
- name: Get current labels
25+
uses: snnaplab/get-labels-action@v1
26+
- name: Check if merge is allowed
27+
if: github.base_ref == 'master' && github.head_ref != 'develop'
28+
run: |
29+
${{ contains(fromJSON(env.LABELS), 'hotfix') }} && exit 0
30+
echo "ERROR: You can only merge to master from develop or hotfixes."
31+
exit 1
1932
check-labels:
2033
# Act doesn't set a pull request number by default, so we skip if it's 0
2134
if: github.event.pull_request.number != 0
2235
name: Check labels
2336
runs-on: ubuntu-latest
2437
steps:
38+
- name: Ignore from Changelog if merge to master
39+
uses: actions-ecosystem/action-add-labels@v1
40+
if: github.base_ref == 'master'
41+
with:
42+
labels: ignoreChangelog
43+
2544
- uses: docker://agilepathway/pull-request-label-checker:v1.6.51
2645
with:
2746
one_of: major,minor,patch,documentation,dependency
@@ -31,6 +50,8 @@ jobs:
3150
runs-on: ubuntu-latest
3251
steps:
3352
- uses: actions/checkout@v4
53+
with:
54+
ref: ${{ github.event.pull_request.head.sha }}
3455

3556
- name: Determine Go version from go.mod
3657
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
@@ -78,15 +99,18 @@ jobs:
7899
if: env.PUSH_UPBOUND == 'true' && env.PUSH_PACKAGE == 'true'
79100
run: make package-push-branchtag -e IMG_TAG="${{ steps.extract_branch.outputs.branch }}" -e IMG_REPO=xpkg.upbound.io
80101

81-
open-pr-component:
82-
if: github.event.action == 'opened'
102+
open-or-update-pr-component:
83103
runs-on: ubuntu-latest
84104
steps:
105+
- name: Get current labels
106+
uses: snnaplab/get-labels-action@v1
107+
85108
- name: Checkout code
86109
uses: actions/checkout@v4
87110
with:
88111
repository: ${{ env.COMPONENT_REPO }}
89112
token: ${{ secrets.GITHUB_TOKEN }}
113+
fetch-depth: 0
90114

91115
- name: Extract branch name
92116
shell: bash
@@ -102,21 +126,44 @@ jobs:
102126
- name: Generate new golden
103127
# Act uses the host's docker to run containers, but then
104128
# they can't access the files that were previously cloned.
105-
if: github.event.pull_request.number != 0
129+
if: github.event.pull_request.number != 0 && github.event.action == 'opened'
106130
run: |
107131
make gen-golden-all
108132
133+
- name: Check if it's a hotfix
134+
id: hotfix_check
135+
run: |
136+
${{ contains(fromJSON(env.LABELS), 'hotfix') }} && echo "base=master" >> $GITHUB_OUTPUT || echo "base=develop" >> $GITHUB_OUTPUT
137+
109138
- name: Create Pull Request
110-
uses: peter-evans/create-pull-request@v6
139+
uses: peter-evans/create-pull-request@v7
140+
id: cpr
111141
with:
112142
token: ${{ secrets.COMPONENT_ACCESS_TOKEN }}
113-
title: 'PR for ${{ env.APP_NAME }} on ${{ steps.extract_branch.outputs.branch }}'
114-
body: "${{ github.event.pull_request.body}}\nLink: ${{ github.event.pull_request.url }}"
143+
title: ${{ github.event.pull_request.title }}
144+
body: "${{ github.event.pull_request.body}}\nLink: ${{ github.event.pull_request.html_url }}"
115145
branch: "${{ env.APP_NAME }}/${{ github.event.pull_request.number }}/${{ steps.extract_branch.outputs.branch }}"
116-
base: master
146+
base: ${{ steps.hotfix_check.outputs.base }}
117147
draft: false
148+
149+
- name: Add link to component PR
150+
uses: tzkhan/pr-update-action@v2
151+
with:
152+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
153+
head-branch-regex: "${{ steps.extract_branch.outputs.branch }}"
154+
body-template: |
155+
Component PR: ${{ steps.cpr.outputs.pull-request-url }}
156+
body-update-action: 'suffix'
157+
body-uppercase-base-match: false
158+
159+
- name: Ignore from Changelog if merge to master
160+
uses: actions-ecosystem/action-add-labels@v1
161+
if: github.base_ref == 'master'
162+
with:
163+
labels: ignoreChangelog
164+
118165
create-release:
119-
if: github.event.pull_request.merged
166+
if: github.event.pull_request.merged && github.base_ref == 'master'
120167
runs-on: ubuntu-latest
121168
steps:
122169
- name: Check for patch label
@@ -201,6 +248,7 @@ jobs:
201248
repository: ${{ env.COMPONENT_REPO }}
202249
token: ${{ secrets.COMPONENT_ACCESS_TOKEN }}
203250
ref: "${{ env.APP_NAME }}/${{ github.event.pull_request.number }}/${{ steps.extract_branch.outputs.branch }}"
251+
fetch-depth: 0
204252

205253
- name: Update tag and run golden
206254
run: |

ci.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ docker-push-branchtag: docker-build-branchtag docker-push ## Push docker image w
3333
.PHONY: package-build
3434
package-build: docker-build
3535
rm -f package/*.xpkg
36-
go run github.com/crossplane/crossplane/cmd/crank@v1.16.0 xpkg build -f package --verbose --embed-runtime-image=${IMG}-func -o package/package.xpkg
36+
go run github.com/crossplane/crossplane/cmd/crank@v1.16.0 xpkg build -f package --verbose --embed-runtime-image=${IMG} -o package/package.xpkg
3737

3838
.PHONY: package-push
3939
package-push: package-build
@@ -44,7 +44,7 @@ package-build-branchtag: export IMG_TAG=$(shell git rev-parse --abbrev-ref HEAD
4444
package-build-branchtag: docker-build-branchtag package-build
4545

4646
.PHONY: package-push-package-branchtag
47-
package-push-package-branchtag: export IMG_TAG=$(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g')
47+
package-push-branchtag: export IMG_TAG=$(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g')
4848
package-push-branchtag: package-build-branchtag package-push
4949

5050
.PHONY: docker-build-local

kind/config.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

kind/kind.mk

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)