mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
1be9ede767
* Pinned workflow by hash - Pinned actions by SHA https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies - Included permissions for some of the actions. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions * Fixed conflicts
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
# 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:
|
|
- uses: actions/github-script@7f4e771d2b3022fa3b8bac499d4a547619f3ab10 # 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
|
|
});
|