Getting the label info on pull request labeled workflow

I am trying to trigger some actions based on label of pull request.
I am not sure how to retrieve the details of the label
Here is a simplified action to illustrate and I expect that all these will show me some info about the labels but all i got is “1” in the output.

What am I doing wrong here? Thanks!

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
  pull_request:
    types: [labeled]
jobs:
  Explore-Gitea-Actions:
    runs-on: ubuntu-latest
    steps:
     - run: echo "${{ gitea.event.label.name }}"
      - run: echo "${{ gitea.event.label.id }}"
      - run: echo "${{ gitea.event.label.description }}"
      - run: echo "${{ gitea.event.label.node_id }}"
      - run: echo "${{ gitea.event.label.color }}"
      - run: echo "${{ gitea.event.label.url }}"

A little more info: I checked on Frequently Asked Questions of Gitea Actions | Gitea Documentation and it listed labeled as one of the actions that is supported and compatible with github. The same actions work on github. (but with the variables being github.xx instead of gitea.xx of course )

Ok, so I just realized that the 1 is just the line number. :sweat_smile:
That means that the echo is not printing anything.

I run into the same issue. Did you find a solution for this?

@mistershadow
No I did not. I plan to try again (much) later. For now I’ve given up.
Please do post here if you manage to get it working.

So, I guess I figured it out.

${{ gitea.event.label.name }}
just isn’t enough to get the data you want. You actually need to use the following.

${{ gitea.event.pull_request.labels[0].name }}

So, you first need to access the pull_request object where you will find the labels array. With the code above you just get the first label. I don’t know if there’s a simple way to just iterate over all labels in case there’s more than one.
I guess to better understand you can have a look at Github - Webhook events and payloads.