diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 81bbfdf3..59fd1709 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,21 +23,34 @@ permissions: contents: read jobs: - triage: + release: runs-on: ubuntu-latest - permissions: - contents: write + + env: + GIT_COMMIT_AUTHOR_EMAIL: ${{ vars.ALLURE_CI_APP_USER_ID }}+${{ vars.ALLURE_CI_APP_SLUG }}[bot]@users.noreply.github.com + GIT_COMMIT_AUTHOR_NAME: ${{ vars.ALLURE_CI_APP_SLUG }}[bot] + steps: - name: "Check release version" run: | expr "${{ inputs.releaseVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' echo "release_version=${{ inputs.releaseVersion }}" >> $GITHUB_ENV + - name: "Check next version" run: | expr "${{ inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$' + + - name: Create GitHub App token + id: app-token + uses: actions/create-github-app-token@v3 + with: + client-id: ${{ vars.ALLURE_CI_APP_CLIENT_ID }} + private-key: ${{ secrets.ALLURE_CI_APP_PRIVATE_KEY }} + permission-contents: write + - uses: actions/checkout@v7 with: - token: ${{ secrets.QAMETA_CI }} + token: ${{ steps.app-token.outputs.token }} - name: "Mark release as preview" if: ${{ inputs.prerelease }} @@ -46,8 +59,8 @@ jobs: - name: "Configure CI Git User" run: | - git config --global user.name qameta-ci - git config --global user.email qameta-ci@qameta.io + git config --global user.name "${GIT_COMMIT_AUTHOR_NAME}" + git config --global user.email "${GIT_COMMIT_AUTHOR_EMAIL}" - name: "Set release version" run: | @@ -108,4 +121,4 @@ jobs: target_commitish: ${{ github.ref }} prerelease: ${{ inputs.prerelease }} env: - GITHUB_TOKEN: ${{ secrets.QAMETA_CI }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}