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
3 changes: 2 additions & 1 deletion .github/workflows/auto-pull-request-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ on:
- dependabot/**

permissions:
contents: read
contents: write
packages: write
pull-requests: write
issues: write

jobs:
call:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/auto-release-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ on:
permissions:
contents: write
packages: write
pull-requests: read
pull-requests: write
issues: write

jobs:
call:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/manual-e2e-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: (Manual) E2E Validate

on:
workflow_dispatch:
inputs:
mode:
description: Validation mode
required: false
default: ref
type: choice
options:
- ref
- image
image_tag:
description: Image tag used when mode=image (for example v1.2.3-test or v1.2.3-rc)
required: false
default: ""
type: string

permissions:
contents: write
packages: read

jobs:
e2e:
uses: devops-infra/triglav/.github/workflows/e2e-action-commit-push.yml@master
with:
mode: ${{ inputs.mode }}
image_tag: ${{ inputs.image_tag }}
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/manual-release-branch-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ permissions:
contents: write
packages: write
pull-requests: write
issues: write

jobs:
call:
Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Change something
run: |
find . -type f -name "*.md" -print0 | xargs -0 sed -i "s/foo/bar/g"
Expand All @@ -132,7 +132,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: Change something
run: |
find . -type f -name "*.md" -print0 | xargs -0 sed -i "s/foo/bar/g"
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository with full history
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0 # Required for force_with_lease
- name: Make some changes
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
action-commit-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- uses: devops-infra/action-commit-push@v1.3.1
id: Pin patch version
Expand All @@ -304,6 +304,29 @@ If you have any questions or need help, please:
- 📝 Create an [issue](https://github.com/devops-infra/action-commit-push/issues)
- 🌟 Star this repository if you find it useful!

## 🧪 End-to-End Validation
Use the manual workflow `.github/workflows/manual-e2e-validate.yml` to validate this action against the centralized E2E repository.

- `mode=ref` validates ref-oriented E2E paths against stable pinned action refs.
- `mode=image` is wired but currently placeholder-only in the central E2E workflow for this action.

CI/CD automation also runs these E2E checks automatically:

- Pull requests: E2E validation runs through reusable org workflows.
- Release branch prepare: E2E validation runs against release candidate refs.
- Release create: E2E validation runs against production release refs.

Example trigger inputs:

```text
mode=ref
```

```text
mode=image
image_tag=v1.2.3-test
```

## Forking
To publish images from a fork, set these variables so Task uses your registry identities:
`DOCKER_USERNAME`, `DOCKER_ORG_NAME`, `GITHUB_USERNAME`, `GITHUB_ORG_NAME`.
Expand Down
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ else
fi

SKIP_BRANCH_CREATION=false
RESET_REQUIRES_FORCE_WITH_LEASE=false
if [[ -z ${FILES_CHANGED} && "${INPUT_AMEND}" != "true" && -z "${INPUT_TARGET_BRANCH}" ]] && ! input_true "${INPUT_ALLOW_EMPTY_COMMIT}"; then
SKIP_BRANCH_CREATION=true
BRANCH="$(get_current_branch)"
Expand Down Expand Up @@ -169,6 +170,7 @@ if [[ "${SKIP_BRANCH_CREATION}" != "true" ]]; then
echo "[ERROR] Failed to hard reset '${BRANCH}' to origin/${MAIN_BRANCH}"
exit 1
}
RESET_REQUIRES_FORCE_WITH_LEASE=true
else
echo "[INFO] Rebasing branch onto ${MAIN_BRANCH}..."
git rebase "origin/${MAIN_BRANCH}" || {
Expand Down Expand Up @@ -249,8 +251,12 @@ fi
if [[ "${INPUT_FORCE}" == "true" ]]; then
echo "[INFO] Force pushing changes using --force"
git push --force origin "${BRANCH}"
elif [[ "${INPUT_FORCE_WITH_LEASE}" == "true" ]]; then
echo "[INFO] Force pushing changes with lease"
elif [[ "${INPUT_FORCE_WITH_LEASE}" == "true" || "${RESET_REQUIRES_FORCE_WITH_LEASE}" == "true" ]]; then
if [[ "${RESET_REQUIRES_FORCE_WITH_LEASE}" == "true" && "${INPUT_FORCE_WITH_LEASE}" != "true" ]]; then
echo "[INFO] Force pushing changes with lease (required after reset_target_branch=true)"
else
echo "[INFO] Force pushing changes with lease"
fi
git push --force-with-lease origin "${BRANCH}"
elif [[ "${SKIP_BRANCH_CREATION}" != "true" && ( -n ${FILES_CHANGED} || "${INPUT_AMEND}" == "true" || -n "${INPUT_TARGET_BRANCH}" ) ]]; then
echo "[INFO] Pushing changes"
Expand Down
Loading