Skip to content

build(deps): bump the non-breaking group across 1 directory with 6 updates #4823

build(deps): bump the non-breaking group across 1 directory with 6 updates

build(deps): bump the non-breaking group across 1 directory with 6 updates #4823

Workflow file for this run

name: PR Milestone
on:
pull_request_target:
types: [ closed ]
jobs:
milestone:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
steps:
- uses: actions/github-script@v7
with:
script: |
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }},
milestone: 64
});
// graphql query to get referenced issues to merged pull request
const query = `query($_url:URI!) {
resource(url:$_url) {
... on PullRequest {
closingIssuesReferences(first:10) {
nodes {
number
}
}
}
}
}`;
const variables = {
_url: "https://github.com/ankidroid/${{ github.event.repository.name }}/pull/${{ github.event.pull_request.number }}"
};
const result = await github.graphql(query, variables);
const refIssues = result.resource.closingIssuesReferences.nodes;
for (issue of refIssues) {
console.log("Adding milestone to linked issue: ", issue.number);
// if issues have milestone, then it will be removed and updated with following
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
milestone: 64
});
}