Skip to content

Commit

Permalink
feat: adding template for github action
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlosjr97 committed Feb 11, 2024
1 parent ec9c67d commit c6dd699
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,17 @@ jobs:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Running release-it using GitHub Action
uses: ./
with:
command: "--ci --dry-run"
git_email: ${{ vars.GIT_EMAIL }}
git_username: ${{ vars.GIT_USERNAME }}
github_token: ${{ secrets.PROJECT_GITHUB_TOKEN }}
gpg_private_key_id: ${{ secrets.GPG_PRIVATE_KEY_ID }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
image_tag: ${{ github.sha }}
plugins_list: "@release-it/conventional-changelog@latest,@release-it/bumper@latest"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

76 changes: 76 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: Github Action - Release-it Containerized
description: Github Action to run Release-It
author: Juan Carlos Blanco Delgado
branding:
icon: zap
color: red
inputs:
command:
description: Command to execute release-it
required: false
default: "--ci"

git_email:
description: Git email to run release-it
required: false
default: ${{ github.actor }}

git_username:
description: Git username to run release-it
required: false
default: "${{ github.actor }}@users.noreply.github.com"

github_token:
description: Github Token to run release-it
required: true
default: ${{ github.token }}

gpg_private_key:
description: GPG Private Key
required: false

gpg_private_key_id:
description: GPG Private Key ID
required: false

image_tag:
description: Image tag used to pass specific version of the action
required: false
default: "latest"

plugins_list:
description: List of Plugins to run with release-it as comma separated
required: false
default: ""

ssh_private_key:
description: SSH Private Key
required: false

runs:
using: composite
steps:
- run: |
docker run \
-e GITHUB_TOKEN=${GITHUB_TOKEN} \
-e GIT_DIRECTORY="/app" \
-e GIT_EMAIL=${GIT_EMAIL} \
-e GIT_USERNAME="${GIT_USERNAME}" \
-e GPG_PRIVATE_KEY="${GPG_PRIVATE_KEY}" \
-e GPG_PRIVATE_KEY_ID="${GPG_PRIVATE_KEY_ID}" \
-e RELEASE_IT_PLUGINS="${RELEASE_IT_PLUGINS}" \
-e SSH_PRIVATE_KEY="${SSH_PRIVATE_KEY}" \
-u root \
-v $PWD:/app \
ghcr.io/juancarlosjr97/release-it-containerized-test:${{ inputs.image_tag }} \
release-it ${{ inputs.command }}
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
GIT_EMAIL: ${{ inputs.git_email }}
GIT_USERNAME: ${{ inputs.git_username }}
GPG_PRIVATE_KEY: ${{ inputs.gpg_private_key }}
GPG_PRIVATE_KEY_ID: ${{ inputs.gpg_private_key_id }}
RELEASE_IT_PLUGINS: ${{ inputs.plugins_list }}
SSH_PRIVATE_KEY: ${{ inputs.ssh_private_key }}
shell: bash

0 comments on commit c6dd699

Please sign in to comment.