From e747cb4a48c44e2318bf94b64efc0e9f0cb0f6a3 Mon Sep 17 00:00:00 2001 From: henne49 Date: Wed, 5 Jun 2024 11:35:47 +0200 Subject: [PATCH] modify github action to use github app --- .github/workflows/version.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 989215b..02834ad 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -18,11 +18,19 @@ jobs: security-events: write steps: - - uses: actions/checkout@v4 + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.VERSION_BUMPER_APPID }} + private-key: ${{ secrets.VERSION_BUMPER_SECRET }} + + - name: Checkout using app token + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 - token: ${{ secrets.PAT_TOKEN }} + #token: ${{ secrets.PAT_TOKEN }} + token: ${{ steps.app-token.outputs.token }} - name: setup .net core uses: actions/setup-dotnet@v4 @@ -41,15 +49,18 @@ jobs: - name: Create version file run: | echo "Version: ${{ steps.gitversion.outputs.majorMinorPatch }}" > version.txt + - name: Commit run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add version.txt git commit -m "Update version [skip ci]" + - name: Push changes uses: ad-m/github-push-action@master with: - github_token: ${{ secrets.PAT_TOKEN }} + #github_token: ${{ secrets.PAT_TOKEN }} + github_token: ${{ steps.app-token.outputs.token }} repository: henne49/dbus-opendtu force_with_lease: true \ No newline at end of file