1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +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 7.0.0 to 7.0.1 (#4432) Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.0 to 7.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/github-script/releases">actions/github-script's releases</a>.</em></p> <blockquote> <h2>v7.0.1</h2> <h2>What's Changed</h2> <ul> <li>Avoid setting <code>baseUrl</code> to undefined when input is not provided by <a href="https://github.com/joshmgross"><code>@​joshmgross</code></a> in <a href="https://redirect.github.com/actions/github-script/pull/439">actions/github-script#439</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/github-script/compare/v7.0.0...v7.0.1">https://github.com/actions/github-script/compare/v7.0.0...v7.0.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/github-script/commit/60a0d83039c74a4aee543508d2ffcb1c3799cdea"><code>60a0d83</code></a> Merge pull request <a href="https://redirect.github.com/actions/github-script/issues/440">#440</a> from actions/joshmgross/v7.0.1</li> <li><a href="https://github.com/actions/github-script/commit/b7fb2001b410c9390cbe9e2c7d5cab7eefb7b29c"><code>b7fb200</code></a> Update version to 7.0.1</li> <li><a href="https://github.com/actions/github-script/commit/12e22ed06b6cf302663f90a925045516e24c8bad"><code>12e22ed</code></a> Merge pull request <a href="https://redirect.github.com/actions/github-script/issues/439">#439</a> from actions/joshmgross/avoid-setting-base-url</li> <li><a href="https://github.com/actions/github-script/commit/d319f8f5b55ea40916b869b2ca9ae2f059c60abf"><code>d319f8f</code></a> Avoid setting <code>baseUrl</code> to undefined when input is not provided</li> <li>See full diff in <a href="https://github.com/actions/github-script/compare/e69ef5462fd455e02edcaf4dd7708eda96b9eda0...60a0d83039c74a4aee543508d2ffcb1c3799cdea">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/github-script&package-manager=github_actions&previous-version=7.0.0&new-version=7.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) 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-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> 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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-23 17:37:59 -03:00
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 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
});