-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Auto add milestone/project to Renovate PRs
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
name: Add milestone and project to GitHub PR | ||
on: | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
permissions: read-all | ||
jobs: | ||
milestone: | ||
name: Add milestone to GitHub PR | ||
if: github.actor == 'renovate[bot]' | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Find current milestone and add it to GitHub PR | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
with: | ||
script: | | ||
try { | ||
const { data: [milestone] } = await github.rest.issues.listMilestones({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
console.log(`Current milestone: ${milestone.title} (${milestone.number})`); | ||
await github.rest.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
milestone: milestone.number, | ||
}); | ||
} catch (error) { | ||
core.setFailed(`Action failed with error ${error}`); | ||
} | ||
project: | ||
name: Add project to GitHub PR | ||
if: github.actor == 'renovate[bot]' | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Add Project | ||
uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v.1.0.2 | ||
with: | ||
project-url: https://github.com/orgs/nginxinc/projects/17/views/1 | ||
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters