first commit
This commit is contained in:
parent
f902085dd0
commit
3a7e1bddfb
@ -2,10 +2,6 @@ FROM gitea/runner-images:ubuntu-latest
|
||||
|
||||
LABEL maintainer="Luke Tainton <luke@tainton.uk>"
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
RUN python3 -m pip install --no-cache --upgrade pip && \
|
||||
python3 -m pip install --no-cache conventional-pre-commit==4.0.0
|
||||
|
||||
# Copies your code file from your action repository to the filesystem path `/` of the container
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
|
47
action.yml
47
action.yml
@ -1,11 +1,44 @@
|
||||
name: 'Conventional Commits Check'
|
||||
description: 'A GitHub/Gitea Action for enforcing adherance to Conventional Commits.'
|
||||
name: "Create Release"
|
||||
description: "A Gitea Action for creating a release."
|
||||
inputs:
|
||||
commit-message: # id of input
|
||||
description: 'Commit message, PR title, etc. to check'
|
||||
server_url:
|
||||
description: Gitea server URL
|
||||
required: false
|
||||
default: ${{ gitea.server_url }}
|
||||
repository:
|
||||
description: Repository name
|
||||
required: false
|
||||
default: ${{ gitea.repository }}
|
||||
release_name:
|
||||
description: Name of the release
|
||||
required: true
|
||||
tag:
|
||||
description: Git tag to use for the release
|
||||
required: true
|
||||
draft:
|
||||
description: Should the release be created as a draft?
|
||||
required: false
|
||||
default: "false"
|
||||
prerelease:
|
||||
description: Should the release be created as a prerelease?
|
||||
required: false
|
||||
default: "false"
|
||||
body:
|
||||
description: "Release content"
|
||||
required: false
|
||||
token:
|
||||
description: Gitea API token
|
||||
required: false
|
||||
default: ${{ gitea.token }}
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
||||
args:
|
||||
- ${{ inputs.commit-message }}
|
||||
- "${{ inputs.server_url }}"
|
||||
- "${{ inputs.repository }}"
|
||||
- "${{ inputs.release_name }}"
|
||||
- "${{ inputs.tag }}"
|
||||
- "${{ inputs.draft }}"
|
||||
- "${{ inputs.prerelease }}"
|
||||
- "${{ inputs.body }}"
|
||||
- "${{ inputs.token }}"
|
||||
|
@ -2,6 +2,18 @@
|
||||
|
||||
set -e
|
||||
|
||||
PRTITLE="$1"
|
||||
echo "$PRTITLE" > /tmp/prtitle.txt
|
||||
conventional-pre-commit --no-color --force-scope --strict --verbose /tmp/prtitle.txt
|
||||
SERVER_URL="$1"
|
||||
REPOSITORY="$2"
|
||||
RELEASE_NAME="$3"
|
||||
TAG_NAME="$4"
|
||||
IS_DRAFT="$5"
|
||||
IS_PRERELEASE="$6"
|
||||
RELEASE_BODY="$7"
|
||||
API_TOKEN="$8"
|
||||
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $API_TOKEN" \
|
||||
-H "accept: application/json" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$RELEASE_NAME\", \"body\": \"$RELEASE_BODY\"}" \
|
||||
"$SERVER_URL/api/v1/repos/$REPOSITORY/releases"
|
||||
|
Loading…
x
Reference in New Issue
Block a user