Skip to content

GitHub action to assign a milestone to pull requests

License

Notifications You must be signed in to change notification settings

zoispag/action-assign-milestone

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Assign milestone to Pull Requests Action

This action will assign a milestone to a Pull Request

Inputs

Name Description Required
token-repo GitHub repo token Yes
milestone Name of milestone to assign Yes

Example usage

name: 'Auto Milestone Assign'

on:
  pull_request:
    types: [opened]

jobs:
  assign-milestone:
    runs-on: ubuntu-latest

    steps:
      - uses: zoispag/action-assign-milestone@v1
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          milestone: 'roadmap'

Dependabot

For pull requests created by dependabot, this action will fail with message: (node:1488) UnhandledPromiseRejectionWarning: HttpError: Resource not accessible by integration.

If you understand the consequences (provide write access) of this action, you can "bypass" this restriction, by triggering this action on the pull_request_target event. Eg:

on:
  pull_request_target:
    types: [opened]

Make sure to read "Keeping your GitHub Actions and workflows secure: Preventing pwn requests" on the GitHub Security Lab website.