diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7a06606..4847136 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 }} + \ No newline at end of file diff --git a/action.yaml b/action.yaml new file mode 100644 index 0000000..e169c09 --- /dev/null +++ b/action.yaml @@ -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