Skip to content

Commit

Permalink
try adding a label the same way as the other step
Browse files Browse the repository at this point in the history
Forks don't generally get access to the access token but lets see if this works
  • Loading branch information
GordonBeeming committed Sep 13, 2023
1 parent bfbc24a commit fc1c89d
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/pr-manage-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down

0 comments on commit fc1c89d

Please sign in to comment.