From 4568ceea8e7fea5d426761225fa36d8656eb5b04 Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Fri, 11 Aug 2023 14:11:56 +0200 Subject: [PATCH] Add external PR labeler action --- .github/workflows/external_pr_labeler.yml | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/external_pr_labeler.yml diff --git a/.github/workflows/external_pr_labeler.yml b/.github/workflows/external_pr_labeler.yml new file mode 100644 index 000000000000..fa484644d3e6 --- /dev/null +++ b/.github/workflows/external_pr_labeler.yml @@ -0,0 +1,38 @@ +name: External PR labeler + +on: + pull_request_target: +# types: +# - opened + +jobs: + label_prs: + name: Label external PRs + runs-on: ubuntu-latest + permissions: read-all + steps: +# - id: is_member +# name: Check if author is an org member +# run: | +# curl -L \ +# -H "Accept: application/vnd.github+json" \ +# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ +# -H "X-GitHub-Api-Version: 2022-11-28" \ +# https://api.github.com/orgs/uyuni-project/members/${{ github.actor }} + + - id: is_member + name: Check if author is an org member + uses: jamessingleton/is-organization-member@1.0.1 + with: + organization: uyuni-project + username: ${{ github.actor }} + token: ${{ secrets.PAC }} + - name: Report + run: | + echo "Actor: ${{ github.actor }}" + echo "Is a member? ${{ steps.is_member.outputs.result }}" +# - uses: tspascoal/get-user-teams-membership@v2 +# with: +# username: ${{ github.actor }} +# team: 'uyuni-project' +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}