diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 1259f08..fedbd21 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -1,11 +1,26 @@ name: Gitea Actions Demo run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest steps: + - uses: actions/github-script@v6 + id: get-mail + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + return (await github.rest.users.getByUsername({ + username: ${{ tojson(github.event.sender.login) }} + })).data.email; + result-encoding: string + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." @@ -21,5 +36,9 @@ jobs: run: echo "${{ github.event.commits[0].author.name }}" - name: commits[0] author email run: echo "${{ github.event.commits[0].author.email }}" - - name: head user login - run: echo "${{ github.event.head.user.login }}" + - name: head_commit author email + run: echo "${{ github.event.head_commit.author.email }}" + - name: event sender + run: echo "${{ github.event.sender.email }}" + - name: script email + run: echo ${{ steps.get-mail.outputs.result }}