releaser-pleaser/action.yml
Ferdinand Hofherr 0f42c753a8
feat: make forge configurable in GitHub Action
Forgejo actions are a near drop-in replacement for GitHub actions. This
commit changes the action.yml file to make the forge configurable. This
allows using the action with forgejo instances.

Changes made:

- Introduce a `forge` input and pass it as the value of the `--forge`
  flag.
- Introduce `api-url` input and pass it as the value of the `--api-url`
  flag. This is required to configure the API URL of the forge. If the
  action is used with GitHub Actions it is simply ignored.
- Pass `inputs.token` as value to the `--api-token` flag. This is
  required as the forgejo client does not respect the `GITHUB_ACTION`
  environment variable.
- Introduce `owner` input and pass it as the value of the `--owner`
  flag. As this was not passed before the default is set to `""`. In
  theory it could be set to the value of `github.repository_owner`.
- Introduce `user` input and pass it as the value of the `--user`
  flag. As this was not passed before the default is set to `""`. GitHub
  Actions does not seem to provide a convenient way to get the
  repository without the owner. As such keeping it at `""` for the
  default is safest.
2026-01-25 15:20:30 +01:00

57 lines
1.8 KiB
YAML

name: 'releaser-pleaser'
description: 'automated releases based on conventional commits'
author: Julian Tölle
branding:
icon: 'package'
color: 'red'
inputs:
# Remember to update docs/reference/github-action.md
branch:
default: main
description: "This branch is used as the target for releases."
token:
description: 'GitHub token for creating and updating release PRs, defaults to using secrets.GITHUB_TOKEN'
required: false
default: ${{ github.token }}
extra-files:
description: 'List of files that are scanned for version references by the generic updater.'
required: false
default: ""
updaters:
description: "List of updaters that are run. Default updaters can be removed by specifying them as -name. Multiple updaters should be concatenated with a comma. Default Updaters: changelog,generic"
required: false
default: ""
forge:
description: "Forge this action is run against"
required: false
default: "github"
api-url:
description: "API URL of the selected forge "
required: false
default: ""
owner:
description: "Owner of the repository"
required: false
default: ""
repo:
description: "Name of the repository"
required: false
default: ""
# Remember to update docs/reference/github-action.md
outputs: { }
runs:
using: 'docker'
image: docker://ghcr.io/apricote/releaser-pleaser:v0.7.1 # x-releaser-pleaser-version
args:
- run
- --forge=${{ inputs.forge }}
- --branch=${{ inputs.branch }}
- --extra-files="${{ inputs.extra-files }}"
- --updaters="${{ inputs.updaters }}"
- --api-url=${{ inputs.api-url }}
- --api-token=${{ inputs.token }}
- --owner=${{ inputs.owner }}
- --repo=${{ inputs.repo }}
env:
GITHUB_TOKEN: "${{ inputs.token }}"
GITHUB_USER: "oauth2"