Skip to content

Commit

Permalink
ci: Auto add milestone/project to Renovate PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg committed Oct 14, 2024
1 parent d240eea commit 2e7f05b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/milestone.yml
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 }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CI/CD:
- Remove platform metadata from the Ansible Galaxy role metadata since platforms are no longer supported in Ansible Galaxy NG.
- Implement OSSF Scorecard.
- Implement Renovate Bot.
- Automatically add milestone and project to Renovate Bot PRs.

## 0.24.3 (July 11, 2024)

Expand Down

0 comments on commit 2e7f05b

Please sign in to comment.