1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/.github/workflows/milestone.yml

59 lines
1.6 KiB
YAML
Raw Normal View History

# shamelessly copied from https://github.com/sigstore/cosign/blob/main/.github/workflows/milestone.yaml
name: milestone
on:
pull_request_target:
types: [closed]
branches:
- main
jobs:
milestone:
runs-on: ubuntu-latest
permissions:
actions: none
checks: none
contents: read
deployments: none
issues: write
packages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: none
steps:
chore(deps): bump actions/github-script from 7f4e771d2b3022fa3b8bac499d4a547619f3ab10 to 6.1.1 (#3322) Bumps actions/github-script from 7f4e771d2b3022fa3b8bac499d4a547619f3ab10 to 6.1.1. This release includes the previously tagged commit. Release notes Sourced from actions/github-script's releases. v6.1.1 What's Changed Bump shell-quote from 1.7.2 to 1.7.3 by @​dependabot in actions/github-script#270 Bump @​actions/core to 1.9.1 by @​cory-miller in actions/github-script#280 Non-code changes Create codeql-analysis.yml by @​joshmgross in actions/github-script#267 Improve grammar by @​kevgo in actions/github-script#269 New Contributors @​kevgo made their first contribution in actions/github-script#269 @​cory-miller made their first contribution in actions/github-script#280 Full Changelog: actions/github-script@v6.1.0...v6.1.1 Commits d50f485 Merge pull request #280 from cory-miller/main 1bdf7b2 Bump @​actions/core to 1.9.1 46a476b Merge pull request #269 from kevgo/patch-1 b682e42 Merge pull request #270 from actions/dependabot/npm_and_yarn/shell-quote-1.7.3 0cc15d0 Bump shell-quote from 1.7.2 to 1.7.3 ebee604 Improve grammar 377d38f Merge pull request #267 from actions/joshmgross/add-codeql 174e812 Create codeql-analysis.yml 7a5c598 Merge pull request #263 from smaeda-ks/update-actions-core cb1c1eb Classify http-client licenses Additional commits viewable in compare view Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase. Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: @dependabot rebase will rebase this PR @dependabot recreate will recreate this PR, overwriting any edits that have been made to it @dependabot merge will merge this PR after your CI passes on it @dependabot squash and merge will squash and merge this PR after your CI passes on it @dependabot cancel merge will cancel a previously requested merge and block automerging @dependabot reopen will reopen this PR if it is closed @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 14:08:49 +02:00
- uses: actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # v6
with:
script: |
if (!context.payload.pull_request.merged) {
console.log('PR was not merged, skipping.');
return;
}
if (!!context.payload.pull_request.milestone) {
console.log('PR has existing milestone, skipping.');
return;
}
milestones = await github.rest.issues.listMilestones({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
sort: 'due_on',
direction: 'asc'
})
if (milestones.data.length === 0) {
console.log('There are no milestones, skipping.');
return;
}
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
milestone: milestones.data[0].number
});