diff --git a/.github/workflows/pr-manage-stale.yml b/.github/workflows/pr-manage-stale.yml index efe04b86ffb..8c8f9ae37db 100644 --- a/.github/workflows/pr-manage-stale.yml +++ b/.github/workflows/pr-manage-stale.yml @@ -24,12 +24,26 @@ jobs: new_pull_request: if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest - steps: - - name: add labels - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: | - Age: 🥚 - New + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: add label + shell: pwsh + run: | + # ensure labels exist - create them if they don't + # https://docs.github.com/en/rest/reference/issues#create-a-label + $label = "Age: 🥚 - New" + $description = "About 2 hours old" + Write-Output "Ensuring label exists: $label ($description))" + gh api repos/${{ github.repository }}/labels -f name="$label" -f color=000000 -f description="$description" + + $thisPr = gh pr view ${{ github.number }} --json number,isCrossRepository + Write-Output "Adding label: $label" + gh pr edit $thisPr.number --add-label "$label" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + scheduled_run: if: ${{ github.event_name != 'pull_request' }}