@@ -103,11 +103,31 @@ jobs:
103103 id-token : write
104104 contents : write
105105 steps :
106+ - name : Generate GitHub App Token
107+ id : release-bot-token
108+ # see https://github.com/actions/create-github-app-token
109+ uses : actions/create-github-app-token@v3
110+ with :
111+ # see https://github.com/organizations/CycloneDX/settings/apps/cyclonedx-internal-release-bot
112+ app-id : 3335294
113+ private-key : ${{ secrets.CDX_RELEASE_BOT_PRIVATE_KEY }}
114+ - name : Get GitHub App User ID
115+ id : release-bot-user-id
116+ run : echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
117+ env :
118+ GH_TOKEN : ${{ steps.release-bot-token.outputs.token }}
119+
106120 - name : Checkout code
107121 # see https://github.com/actions/checkout
108122 uses : actions/checkout@v6
109123 with :
110124 fetch-depth : 0
125+ token : ${{ steps.release-bot-token.outputs.token }}
126+ - name : git config
127+ run : |
128+ git config user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
129+ git config user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
130+ git config commit.signoff true
111131
112132 - name : Setup python
113133 # see https://github.com/actions/setup-python
@@ -134,7 +154,7 @@ jobs:
134154 # see https://github.com/python-semantic-release/python-semantic-release
135155 uses : python-semantic-release/python-semantic-release@v10.0.2
136156 with :
137- github_token : ${{ secrets.GITHUB_TOKEN }}
157+ github_token : ${{ steps.release-bot-token.outputs.token }}
138158 force : ${{ github.event.inputs.release_force }}
139159 prerelease : ${{ github.event.inputs.prerelease }}
140160 prerelease_token : ${{ github.event.inputs.prerelease_token }}
@@ -151,5 +171,5 @@ jobs:
151171 # see https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html#python-semantic-release-publish-action
152172 uses : python-semantic-release/publish-action@v10
153173 with :
154- github_token : ${{ secrets.GITHUB_TOKEN }}
174+ github_token : ${{ steps.release-bot-token.outputs.token }}
155175 tag : ${{ steps.release.outputs.tag }}
0 commit comments