Skip to content

refactor: upgrade to PHP 8.1 with rector #22

refactor: upgrade to PHP 8.1 with rector

refactor: upgrade to PHP 8.1 with rector #22

name: Auto Remove "stale" label
on:
pull_request:
branches:
- develop
- '4.*'
jobs:
check-conflict:
runs-on: ubuntu-22.04
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get PR Detail
id: PR-detail
run: echo "detail=$(gh pr view $PR_URL --json mergeable,url,labels,author)" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
- name: 'Remove label "stale"'
env:
PR_DETAIL: ${{ steps.PR-detail.outputs.detail }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
# MERGEABLE with 'stale' label
if [ "$(echo $PR_DETAIL | jq -r '.mergeable')" == "MERGEABLE" ] && \
[ "$(echo $PR_DETAIL | jq -r '.labels[] | select(.name == "stale")')" != "" ]; then
# remove 'stale' label
gh pr edit $PR_URL --remove-label "stale"
fi