Add CoC, and add examples and better documentation to the readme #146
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
name: Set Milestone | |
on: | |
pull_request: | |
types: | |
- assigned | |
- opened | |
- synchronize | |
- reopened | |
- edited | |
- ready_for_review | |
- review_requested | |
jobs: | |
set-milestone: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
if: github.event.pull_request.milestone == null | |
- name: 'Get Previous tag' | |
if: github.event.pull_request.milestone == null | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@master" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- name: 'Get next minor version' | |
if: github.event.pull_request.milestone == null | |
id: semvers | |
uses: "WyriHaximus/github-action-next-semvers@master" | |
with: | |
version: ${{ steps.previoustag.outputs.tag }} | |
- name: 'Get Milestones' | |
if: github.event.pull_request.milestone == null | |
uses: "WyriHaximus/github-action-get-milestones@master" | |
id: milestones | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- run: printf "::set-output name=number::%s" $(printenv MILESTONES | jq --arg MILESTONE $(printenv MILESTONE) '.[] | select(.title == $MILESTONE) | .number') | |
if: github.event.pull_request.milestone == null | |
id: querymilestone | |
env: | |
MILESTONES: ${{ steps.milestones.outputs.milestones }} | |
MILESTONE: ${{ steps.semvers.outputs.minor }} | |
- name: 'Create Milestone' | |
if: github.event.pull_request.milestone == null && steps.querymilestone.outputs.number == '' | |
id: createmilestone | |
uses: "WyriHaximus/github-action-create-milestone@master" | |
with: | |
title: ${{ steps.semvers.outputs.minor }} | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- name: 'Select found or created Milestone' | |
if: github.event.pull_request.milestone == null | |
id: selectmilestone | |
run: | | |
if [ $(echo ${QUERY_NUMBER} | wc -c) -eq 1 ] ; then | |
printf "::set-output name=number::%s" "${CREATED_NUMBER}" | |
exit 0 | |
fi | |
printf "::set-output name=number::%s" "${QUERY_NUMBER}" | |
env: | |
CREATED_NUMBER: ${{ steps.createmilestone.outputs.number }} | |
QUERY_NUMBER: ${{ steps.querymilestone.outputs.number }} | |
- name: 'Set Milestone' | |
if: github.event.pull_request.milestone == null | |
uses: "WyriHaximus/github-action-set-milestone@master" | |
with: | |
issue_number: ${{ github.event.pull_request.number }} | |
milestone_number: ${{ steps.selectmilestone.outputs.number }} | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |