build(deps): Bump actions/create-github-app-token from 2 to 3 in the github-actions group #203
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check pull request | |
| on: | |
| pull_request: | |
| types: | |
| - edited | |
| - opened | |
| - reopened | |
| - synchronize | |
| jobs: | |
| check-pull-request: | |
| name: Check pull request | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| type: ${{ steps.get-type.outputs.type }} | |
| steps: | |
| - uses: amannn/action-semantic-pull-request@v6 | |
| id: get-type | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| label-pull-request: | |
| name: Label pull request | |
| runs-on: ubuntu-latest | |
| needs: | |
| - check-pull-request | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Get GitHub token | |
| uses: actions/create-github-app-token@v3 | |
| id: github-token | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ steps.github-token.outputs.token }} | |
| - name: Label PR based on semantic title | |
| env: | |
| GH_TOKEN: ${{ steps.github-token.outputs.token }} | |
| PR_TYPE: ${{ needs.check-pull-request.outputs.type }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| if [ -z "$PR_TYPE" ]; then | |
| echo "No semantic type found in PR title. Skipping labeling." | |
| exit 0 | |
| fi | |
| if [ "$PR_TYPE" = "feat" ]; then | |
| PR_TYPE="feature" | |
| fi | |
| if [ "$PR_TYPE" = "fix" ]; then | |
| PR_TYPE="bug" | |
| fi | |
| if [ "$PR_TYPE" = "perf" ]; then | |
| PR_TYPE="performance" | |
| fi | |
| echo "Labeling PR with type: $PR_TYPE" | |
| gh pr edit "$PR_NUMBER" --add-label "$PR_TYPE" |