Skip to content

Commit

Permalink
Set up assign milestone to use base environment variables, not branch…
Browse files Browse the repository at this point in the history
… origin
  • Loading branch information
seanbudd committed Aug 8, 2024
1 parent a2bbd4c commit 6e48cd7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/assign-milestone-on-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ env:
on:
issues:
types: [closed]
pull_request:
pull_request_target:
types: [closed]

permissions:
issues: write
pull-requests: write

jobs:
assign-milestone:
runs-on: ubuntu-latest
Expand All @@ -19,7 +23,7 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueOrPr = context.payload.issue || context.payload.pull_request;
const issueOrPr = context.payload.issue || context.payload.pull_request_target;
if (!issueOrPr.milestone) {
core.setOutput('milestoneNotSet', 'true');
} else {
Expand All @@ -32,7 +36,7 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueOrPrNumber = (context.payload.issue || context.payload.pull_request).number;
const issueOrPrNumber = (context.payload.issue || context.payload.pull_request_target).number;
const repository = context.repo;
await github.rest.issues.update({
...repository,
Expand Down

0 comments on commit 6e48cd7

Please sign in to comment.