Skip to content

ci(github-actions): use create-github-app-token to generate semantic … #180

ci(github-actions): use create-github-app-token to generate semantic …

ci(github-actions): use create-github-app-token to generate semantic … #180

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Release
on:
workflow_dispatch:
inputs:
dry-run:
type: boolean
description: Dry Run
default: false
required: false
push:
branches:
- main
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
id: app-token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: Semantic Release
uses: cycjimmy/semantic-release-action@cb425203a562475bca039ba4dbf90c7f9ac790f4 # v4.1.0
with:
dry_run: "${{ inputs.dry-run }}"
semantic_version: 24.1.1
extra_plugins: |
- conventional-changelog-conventionalcommits@8.0.0
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}