Skip to content

Commit

Permalink
Update pr-18.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Nov 21, 2024
1 parent d420d03 commit 877fd00
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/pr-18.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ on:
jobs:
run:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- name: Create PR review request
continue-on-error: true
env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
# GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
url: ${{ github.event.pull_request.html_url }}
run: |
# https://cli.github.com/manual/gh_api
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
-f "reviewers[]=eldy"
#gh pr edit "$url" --add-assignee lvessiller-opendsi,rycks --add-reviewer lvessiller-opendsi,rycks
#gh pr merge "$url" --merge --auto

- name: Checkout repository
uses: actions/checkout@v2

- name: Install GitHub CLI
run: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 && \
sudo apt-add-repository https://cli.github.com/packages && \
sudo apt update && \
sudo apt install gh -y

- name: Authenticate GitHub CLI
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: gh auth login --with-token <<< "$GH_TOKEN"

- name: Assign reviewer
env:
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: |
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
gh pr edit $pr_number --add-reviewer "$REVIEWER"

0 comments on commit 877fd00

Please sign in to comment.