Skip to content

build(deps): bump org.jlleitschuh.gradle.ktlint from 11.6.1 to 12.0.2 #4883

build(deps): bump org.jlleitschuh.gradle.ktlint from 11.6.1 to 12.0.2

build(deps): bump org.jlleitschuh.gradle.ktlint from 11.6.1 to 12.0.2 #4883

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: 51
});
// 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: 51
});
}