├── README.md ├── .gitignore ├── run.sh ├── LICENSE └── action.yaml /README.md: -------------------------------------------------------------------------------- 1 | # interesting-category-action 2 | Validate that the next draft release is interesting 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euxo pipefail 3 | if [ $GITHUB_EVENT_NAME = check_run ] 4 | then 5 | if [ -z "$RELEASE_DRAFT_BODY" ] 6 | then 7 | RELEASE_DRAFT_BODY="$(gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '.[] | select(.draft == true and .name == "next") | .body')" 8 | fi 9 | 10 | if echo "$RELEASE_DRAFT_BODY" | egrep "$INTERESTING_CATEGORIES" 11 | then 12 | echo "interesting=true" >> $GITHUB_OUTPUT 13 | else 14 | echo "interesting=false" >> $GITHUB_OUTPUT 15 | fi 16 | else 17 | echo "interesting=true" >> $GITHUB_OUTPUT 18 | fi 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jenkins Infra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /action.yaml: -------------------------------------------------------------------------------- 1 | name: interesting-category 2 | description: Validate that the next draft release is interesting 3 | inputs: 4 | GITHUB_TOKEN: 5 | description: Token to run with, defaults to the repository GITHUB_TOKEN 6 | required: true 7 | INTERESTING_CATEGORIES: 8 | required: true 9 | description: | 10 | Regexp of emojis from https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.yml representing changes of interest to users. 11 | By default excludes 📦📝👻🚦 under the assumption these do not normally merit a release. 12 | An output of interesting = true/false will be set, the 'workflow_dispatch' (explicit release) is always 'interesting'. 13 | default: '[💥🚨🎉🐛⚠🚀🌐👷]|:(boom|tada|construction_worker):' 14 | RELEASE_DRAFT_BODY: 15 | required: false 16 | description: | 17 | Release draft body produced by `release-drafter/release-drafter` action; defaults to looking for a draft release named `next` 18 | default: "" 19 | outputs: 20 | interesting: 21 | description: whether the category is interesting or not, true / false will be the result 22 | value: ${{ steps.interesting-category.outputs.interesting }} 23 | runs: 24 | using: composite 25 | steps: 26 | - run: $GITHUB_ACTION_PATH/run.sh 27 | id: interesting-category 28 | shell: bash 29 | env: 30 | GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} 31 | INTERESTING_CATEGORIES: ${{ inputs.INTERESTING_CATEGORIES }} 32 | RELEASE_DRAFT_BODY: ${{ inputs.RELEASE_DRAFT_BODY }} 33 | --------------------------------------------------------------------------------