Skip to content

Commit 84cf7d9

Browse files
feat: add Triglav as end-to-end test orchestrator (#210)
* feat: add Triglav as end-to-end test orchestrator * fix: enhance force-with-lease handling for action-commit-push --------- Co-authored-by: ChristophShyper <45788587+ChristophShyper@users.noreply.github.com>
1 parent 4e357fc commit 84cf7d9

6 files changed

Lines changed: 70 additions & 8 deletions

File tree

.github/workflows/auto-pull-request-create.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ on:
99
- dependabot/**
1010

1111
permissions:
12-
contents: read
12+
contents: write
1313
packages: write
1414
pull-requests: write
15+
issues: write
1516

1617
jobs:
1718
call:

.github/workflows/auto-release-create.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ on:
2121
permissions:
2222
contents: write
2323
packages: write
24-
pull-requests: read
24+
pull-requests: write
25+
issues: write
2526

2627
jobs:
2728
call:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: (Manual) E2E Validate
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
mode:
7+
description: Validation mode
8+
required: false
9+
default: ref
10+
type: choice
11+
options:
12+
- ref
13+
- image
14+
image_tag:
15+
description: Image tag used when mode=image (for example v1.2.3-test or v1.2.3-rc)
16+
required: false
17+
default: ""
18+
type: string
19+
20+
permissions:
21+
contents: write
22+
packages: read
23+
24+
jobs:
25+
e2e:
26+
uses: devops-infra/triglav/.github/workflows/e2e-action-commit-push.yml@master
27+
with:
28+
mode: ${{ inputs.mode }}
29+
image_tag: ${{ inputs.image_tag }}
30+
secrets: inherit

.github/workflows/manual-release-branch-prepare.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ permissions:
2727
contents: write
2828
packages: write
2929
pull-requests: write
30+
issues: write
3031

3132
jobs:
3233
call:

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
runs-on: ubuntu-latest
109109
steps:
110110
- name: Checkout repository
111-
uses: actions/checkout@v5
111+
uses: actions/checkout@v6
112112
- name: Change something
113113
run: |
114114
find . -type f -name "*.md" -print0 | xargs -0 sed -i "s/foo/bar/g"
@@ -132,7 +132,7 @@ jobs:
132132
runs-on: ubuntu-latest
133133
steps:
134134
- name: Checkout repository
135-
uses: actions/checkout@v5
135+
uses: actions/checkout@v6
136136
- name: Change something
137137
run: |
138138
find . -type f -name "*.md" -print0 | xargs -0 sed -i "s/foo/bar/g"
@@ -171,7 +171,7 @@ jobs:
171171
runs-on: ubuntu-latest
172172
steps:
173173
- name: Checkout repository with full history
174-
uses: actions/checkout@v5
174+
uses: actions/checkout@v6
175175
with:
176176
fetch-depth: 0 # Required for force_with_lease
177177
- name: Make some changes
@@ -277,7 +277,7 @@ jobs:
277277
action-commit-push:
278278
runs-on: ubuntu-latest
279279
steps:
280-
- uses: actions/checkout@v5
280+
- uses: actions/checkout@v6
281281
282282
- uses: devops-infra/action-commit-push@v1.3.1
283283
id: Pin patch version
@@ -304,6 +304,29 @@ If you have any questions or need help, please:
304304
- 📝 Create an [issue](https://github.com/devops-infra/action-commit-push/issues)
305305
- 🌟 Star this repository if you find it useful!
306306

307+
## 🧪 End-to-End Validation
308+
Use the manual workflow `.github/workflows/manual-e2e-validate.yml` to validate this action against the centralized E2E repository.
309+
310+
- `mode=ref` validates ref-oriented E2E paths against stable pinned action refs.
311+
- `mode=image` is wired but currently placeholder-only in the central E2E workflow for this action.
312+
313+
CI/CD automation also runs these E2E checks automatically:
314+
315+
- Pull requests: E2E validation runs through reusable org workflows.
316+
- Release branch prepare: E2E validation runs against release candidate refs.
317+
- Release create: E2E validation runs against production release refs.
318+
319+
Example trigger inputs:
320+
321+
```text
322+
mode=ref
323+
```
324+
325+
```text
326+
mode=image
327+
image_tag=v1.2.3-test
328+
```
329+
307330
## Forking
308331
To publish images from a fork, set these variables so Task uses your registry identities:
309332
`DOCKER_USERNAME`, `DOCKER_ORG_NAME`, `GITHUB_USERNAME`, `GITHUB_ORG_NAME`.

entrypoint.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ else
9898
fi
9999

100100
SKIP_BRANCH_CREATION=false
101+
RESET_REQUIRES_FORCE_WITH_LEASE=false
101102
if [[ -z ${FILES_CHANGED} && "${INPUT_AMEND}" != "true" && -z "${INPUT_TARGET_BRANCH}" ]] && ! input_true "${INPUT_ALLOW_EMPTY_COMMIT}"; then
102103
SKIP_BRANCH_CREATION=true
103104
BRANCH="$(get_current_branch)"
@@ -169,6 +170,7 @@ if [[ "${SKIP_BRANCH_CREATION}" != "true" ]]; then
169170
echo "[ERROR] Failed to hard reset '${BRANCH}' to origin/${MAIN_BRANCH}"
170171
exit 1
171172
}
173+
RESET_REQUIRES_FORCE_WITH_LEASE=true
172174
else
173175
echo "[INFO] Rebasing branch onto ${MAIN_BRANCH}..."
174176
git rebase "origin/${MAIN_BRANCH}" || {
@@ -249,8 +251,12 @@ fi
249251
if [[ "${INPUT_FORCE}" == "true" ]]; then
250252
echo "[INFO] Force pushing changes using --force"
251253
git push --force origin "${BRANCH}"
252-
elif [[ "${INPUT_FORCE_WITH_LEASE}" == "true" ]]; then
253-
echo "[INFO] Force pushing changes with lease"
254+
elif [[ "${INPUT_FORCE_WITH_LEASE}" == "true" || "${RESET_REQUIRES_FORCE_WITH_LEASE}" == "true" ]]; then
255+
if [[ "${RESET_REQUIRES_FORCE_WITH_LEASE}" == "true" && "${INPUT_FORCE_WITH_LEASE}" != "true" ]]; then
256+
echo "[INFO] Force pushing changes with lease (required after reset_target_branch=true)"
257+
else
258+
echo "[INFO] Force pushing changes with lease"
259+
fi
254260
git push --force-with-lease origin "${BRANCH}"
255261
elif [[ "${SKIP_BRANCH_CREATION}" != "true" && ( -n ${FILES_CHANGED} || "${INPUT_AMEND}" == "true" || -n "${INPUT_TARGET_BRANCH}" ) ]]; then
256262
echo "[INFO] Pushing changes"

0 commit comments

Comments
 (0)