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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Request
name: (Auto) Create Pull Request

on:
push:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
run: task lint

build-and-push:
name: Build and Push test
name: Build and push
runs-on: ubuntu-24.04-arm
needs: [lint]
steps:
Expand Down Expand Up @@ -85,11 +85,10 @@ jobs:
version: 3.x

- name: Get template
shell: bash
run: task git:get-pr-template

- name: Create Pull Request
uses: devops-infra/action-pull-request@v0.6
uses: devops-infra/action-pull-request@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Manual Release
name: (Auto) Create release

on:
workflow_dispatch:
inputs:
version:
description: Release version (e.g., v1.2.3)
required: true
type: string
default: __TAKEN_FROM_ACTION_YML__
pull_request:
types: [closed]
push:
branches:
- release/**

permissions:
contents: write
packages: write

jobs:
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
name: Create Release
runs-on: ubuntu-24.04-arm
steps:
Expand All @@ -32,9 +31,9 @@ jobs:
- name: Create and push git tags
id: version
env:
VERSION_OVERRIDE: ${{ github.event.inputs.version }}
VERSION_SUFFIX: ""
run: |
task lint
task git:set-config
task version:tag-release
echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT"
Expand All @@ -52,25 +51,22 @@ jobs:

- name: Get Docker commands
env:
VERSION_OVERRIDE: ${{ github.event.inputs.version }}
VERSION_SUFFIX: ""
run: task docker:cmds

- name: Build and push Docker images
- name: Build and Push
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_OVERRIDE: ${{ github.event.inputs.version }}
VERSION_SUFFIX: ""
run: task docker:push

- name: Inspect image
env:
VERSION_OVERRIDE: ${{ github.event.inputs.version }}
VERSION_SUFFIX: ""
run: task docker:push:inspect

- name: Create GitHub Release
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.REL_VERSION }}
Expand All @@ -81,7 +77,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update Docker Hub description
- name: Update Docker hub description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ vars.DOCKER_USERNAME }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Weekly Dependency Check
name: (Cron) Check dependencies

on:
schedule:
Expand All @@ -11,7 +11,7 @@ permissions:

jobs:
dependency-check:
name: Test Dependencies
name: Test dependencies
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
Expand All @@ -36,6 +36,9 @@ jobs:
image: tonistiigi/binfmt:latest
platforms: amd64,arm64

- name: Run linters
run: task lint

- name: Get Docker commands
run: task docker:cmds

Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/manual-update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: (Manual) Update Version

on:
workflow_dispatch:
inputs:
type:
description: Bump type
required: true
default: patch
type: choice
options:
- patch
- minor
- major
- set
version:
description: Explicit version when type="set" (e.g., v1.2.3)
required: false
default: ''

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

jobs:
update:
name: Update version and push release branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true

- name: Install Task
uses: arduino/[email protected]
with:
version: 3.x

- name: Update version
id: version
env:
BUMP_TYPE: ${{ github.event.inputs.type }}
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
set -eux
case "${BUMP_TYPE}" in
set)
if [ -z "${INPUT_VERSION}" ]; then
echo "Missing version for type=set"
exit 1
fi
task version:set VERSION_OVERRIDE="${INPUT_VERSION}"
;;
patch)
task version:update:patch
;;
minor)
task version:update:minor
;;
major)
task version:update:major
;;
*)
echo "Unknown type: ${BUMP_TYPE}"
exit 1
;;
esac
echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT"

- name: Install Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Install QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: amd64,arm64

- name: Get Docker commands
run: task docker:cmds

- name: Build and push test image
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: task docker:push

- name: Inspect image
run: task docker:push:inspect

- name: Get template
env:
VERSION_SUFFIX: ""
run: |
task git:set-config
task git:get-pr-template

- name: Push to release branch
uses: devops-infra/action-commit-push@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: ":rocket: Bump version to ${{ steps.version.outputs.REL_VERSION }}"
target_branch: ${{ format('release/{0}', steps.version.outputs.REL_VERSION) }}

- name: Create Pull Request
uses: devops-infra/action-pull-request@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
assignee: ${{ github.actor }}
template: .tmp/PULL_REQUEST_TEMPLATE.md
get_diff: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Krzysztof Szyper aka ChristophShyper (https://shyper.pro/)
Copyright (c) 2020 Krzysztof Szyper aka ChristophShyper (https://shyper.pro/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 11 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# πŸš€ GitHub Action for creating Pull Requests

**GitHub Action that will create a pull request from the currently selected branch.**

**Useful in combination with my other action [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).**


## πŸ“¦ Available on

- **Docker Hub:** [devopsinfra/action-pull-request:latest](https://hub.docker.com/repository/docker/devopsinfra/action-pull-request)
- **GitHub Packages:** [ghcr.io/devops-infra/action-pull-request:latest](https://github.com/devops-infra/action-pull-request/pkgs/container/action-pull-request)


## ✨ Features

* Creates pull request if triggered from a current branch or any specified by `source_branch` to a `target_branch`
* Title and body of a pull request can be specified with `title` and `body`
* Can assign `assignee`, `reviewer`, one or more `label`, a `milestone` or mark it as a `draft`
Expand All @@ -22,8 +17,11 @@
* Supports both `amd64` and `arm64` architectures


## πŸ“Š Badges
## πŸ”— Related Actions
**Useful in combination with my other action [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push).**


## πŸ“Š Badges
[
![GitHub repo](https://img.shields.io/badge/GitHub-devops--infra%2Faction--pull--request-blueviolet.svg?style=plastic&logo=github)
![GitHub last commit](https://img.shields.io/github/last-commit/devops-infra/action-pull-request?color=blueviolet&logo=github&style=plastic&label=Last%20commit)
Expand All @@ -39,8 +37,14 @@
](https://hub.docker.com/r/devopsinfra/action-pull-request "shields.io")


## πŸ“– API Reference
## 🏷️ Version Tags: vX, vX.Y, vX.Y.Z
This action supports three tag levels for flexible versioning:
- `vX`: latest patch of the major version (e.g., `v1`).
- `vX.Y`: latest patch of the minor version (e.g., `v1.2`).
- `vX.Y.Z`: fixed to a specific release (e.g., `v1.2.3`).


## πŸ“– API Reference
```yaml
- name: Run the Action
uses: devops-infra/[email protected]
Expand All @@ -65,7 +69,6 @@


### πŸ”§ Input Parameters

| Input Variable | Required | Default | Description |
|-----------------|----------|-------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| `github_token` | **Yes** | `""` | GitHub token `${{ secrets.GITHUB_TOKEN }}` |
Expand All @@ -87,15 +90,13 @@


### πŸ“€ Outputs Parameters

| Output | Description |
|-------------|-------------------------------|
| `url` | Pull request URL |
| `pr_number` | Number of GitHub pull request |


### ➿ How get_diff works

In previous versions occurrences of following strings in a template result with replacing them with list of commits and list of modified files (`<!-- Diff commits -->` and `<!-- Diff files -->`).

Now this action will expect to have three types of comment blocks. Meaning anything between `START` and `END` comment will get replaced. This is especially important when updating pull request with new commits.
Expand All @@ -118,7 +119,6 @@ Blue areas show fields that can be set in action configuration.


### πŸ“ Basic Example

Create pull request for non-master branches:

```yaml
Expand All @@ -141,7 +141,6 @@ jobs:
```

### πŸ”€ Advanced Example

Use first commit as a title and part of body, add a label based on a branch name, add git differences in the template:

```yaml
Expand Down Expand Up @@ -173,7 +172,6 @@ jobs:
```

### 🎯 Use specific version

Run the Action with a specific version tag.

```yaml
Expand All @@ -198,24 +196,16 @@ jobs:
```


## πŸ”— Related Actions

- [devops-infra/action-commit-push](https://github.com/devops-infra/action-commit-push) - Commit and push changes to a git repository


## 🀝 Contributing

Contributions are welcome! See [CONTRIBUTING](https://github.com/devops-infra/.github/blob/master/CONTRIBUTING.md).
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


## πŸ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


## πŸ’¬ Support

If you have any questions or need help, please:
- πŸ“ Create an [issue](https://github.com/devops-infra/action-pull-request/issues)
- 🌟 Star this repository if you find it useful!
Loading