Skip to content

Commit

Permalink
Fixes #1: avoid releasing after check_run unless changelog looks inte…
Browse files Browse the repository at this point in the history
…resting
  • Loading branch information
jglick committed Feb 16, 2021
1 parent 8d95c38 commit cddf992
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@ inputs:
required: true
MAVEN_TOKEN:
required: true
INTERESTING_CATEGORIES:
required: true
description: |
Regexp of emojis from https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.yml representing changes of interest to users.
By default excludes 📦📝👻🚦 under the assumption these do not normally merit a release.
Ignored when using workflow_dispatch (explicit release); when using the check_run trigger (automatic), the release is skipped unless the draft changelog matches.
default: '[💥🚨🎉🐛⚠🚀👷]|:(boom|tada|construction_worker):'
runs:
using: composite
steps:
- run: GITHUB_TOKEN=${{ inputs.GITHUB_TOKEN }} MAVEN_USERNAME=${{ inputs.MAVEN_USERNAME }} MAVEN_TOKEN=${{ inputs.MAVEN_TOKEN }} $GITHUB_ACTION_PATH/run.sh
- run: GITHUB_TOKEN=${{ inputs.GITHUB_TOKEN }} MAVEN_USERNAME=${{ inputs.MAVEN_USERNAME }} MAVEN_TOKEN=${{ inputs.MAVEN_TOKEN }} INTERESTING_CATEGORIES='${{ inputs.INTERESTING_CATEGORIES }}' $GITHUB_ACTION_PATH/run.sh
shell: bash
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
set -euxo pipefail
if [ $GITHUB_EVENT_NAME = check_run ]
then
gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '.[] | select(.draft == true and .name == "next") | .body' | egrep "$INTERESTING_CATEGORIES"
fi
export MAVEN_OPTS=-Djansi.force=true
mvn -B -V -s $GITHUB_ACTION_PATH/settings.xml -ntp -Dstyle.color=always -Dset.changelist -DaltDeploymentRepository=maven.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/ -Pquick-build clean deploy
version=$(mvn -B -ntp -Dset.changelist -Dexpression=project.version -q -DforceStdout help:evaluate)
Expand Down

0 comments on commit cddf992

Please sign in to comment.