Skip to content

chore(deps): update gradle/actions action to v5.0.1 #359

chore(deps): update gradle/actions action to v5.0.1

chore(deps): update gradle/actions action to v5.0.1 #359

Workflow file for this run

name: PullRequestLabeler
on: pull_request
permissions: read-all
jobs:
pr-labeler:
name: Label PR
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Get branch name
id: get-branch-name
env:
HEAD_REF: ${{ github.head_ref }}
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${HEAD_REF}" >> $GITHUB_OUTPUT
else
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Convert to label
id: convert-to-label
run: |
if [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == feat/* ]]; then
echo "LABEL_NAME=enhancement" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == feature/* ]]; then
echo "LABEL_NAME=enhancement" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == fix/* ]]; then
echo "LABEL_NAME=bug" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == bugfix/* ]]; then
echo "LABEL_NAME=bug" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == bug/* ]]; then
echo "LABEL_NAME=bug" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == renovate/* ]]; then
echo "LABEL_NAME=dependency" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == dep/* ]]; then
echo "LABEL_NAME=dependency" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == docs/* ]]; then
echo "LABEL_NAME=documentation" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == release/* ]]; then
echo "LABEL_NAME=release" >> $GITHUB_OUTPUT
elif [[ "${{ steps.get-branch-name.outputs.BRANCH_NAME }}" == chore/* ]]; then
echo "LABEL_NAME=chore" >> $GITHUB_OUTPUT
else
echo "LABEL_NAME=none" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Add label
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
if: ${{ steps.convert-to-label.outputs.LABEL_NAME != 'none' }}
with:
script: |
github.rest.issues.addLabels({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["${{ steps.convert-to-label.outputs.LABEL_NAME }}"]
});