algolia / shipjs

Take control of what is going to be your next release.
https://community.algolia.com/shipjs/
MIT License
765 stars 30 forks source link

Comment on the issues and PRs after release #746

Open eunjae-lee opened 4 years ago

eunjae-lee commented 4 years ago
// ship.js.config
{
  commentOnGitHubAfterRelease: true, // this name is totally temporary
}

With commentOnGitHubAfterRelease: true, at the end of yarn release:trigger, Ship.js will go to all the related PRs and leave comments like This PR is included in the recent release vx.y.z.

It seems semantic-release does this, too.

example: https://github.com/downshift-js/downshift/pull/971#issuecomment-599040696

eunjae-lee commented 4 years ago

User could provide a config like the following to allow many use-cases.

// ship.config.js

const coreTeam = ['username1', 'username2', ...];

export default {
  commentAfterRelease: ({
    id, // issue or pr number,
    type, // 'issue' | 'pull-request',
    author, // username of the issue or pr
  }) => {
    return coreMaintainers.indexOf(author) === -1; // notify only if it's coming from community
  }
}

// or

export default {
  commentAfterRelease: async ({ id }) => {
    const labels = await getLabelsFromGitHub(id);
    return labels.indexOf("notify after release") >= 0;
  }
}