File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -e - o pipefail
2+ set -e + o pipefail
33
44outfile=" release_notes_prepared.md"
55infile=" ReleaseNotes.md"
1111
1212
1313# Extract the release notes.
14- # Note: "|| test $? -eq 141" is added to ignore SIGPIPE errors when head finishes before grep is done.
14+ # Note: with "set +o pipefail", pipe errors are ignored. They might occur when
15+ # head finishes before grep is done.
16+ # Error message: "grep: write error: Broken pipe"
17+ #
18+ # Note2: "|| test $? -eq 141" is added to ignore SIGPIPE errors when head finishes before grep is done.
19+ # See https://stackoverflow.com/questions/22464786/ignoring-bash-pipefail-for-error-code-141
20+ # But that doesn't seem to work.
1521BEGIN_LINE=$( (grep -n " ^## " " ${infile} " || test $? -eq 141) | head -1| cut -d " :" -f 1)
1622END_LINE=$( (grep -n " ^## " " ${infile} " || test $? -eq 141) | head -2| tail -1| cut -d " :" -f 1)
1723END_LINE=$(( END_LINE - 1 ))
Original file line number Diff line number Diff line change @@ -145,15 +145,23 @@ jobs:
145145 name : update-site
146146 - name : Prepare Release Notes
147147 run : .ci/files/prepare_release_notes.sh
148+ - uses : actions/create-github-app-token@v2
149+ id : pmd-actions-helper-app-token
150+ with :
151+ app-id : ${{ secrets.PMD_ACTIONS_HELPER_ID }}
152+ private-key : ${{ secrets.PMD_ACTIONS_HELPER_PRIVATE_KEY }}
153+ owner : pmd
154+ repositories : pmd-eclipse-plugin
155+ permission-contents : write # create a release
148156 - name : Create Release
149157 env :
150158 # Token required for GH CLI:
151- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
159+ GH_TOKEN : ${{ steps.pmd-actions-helper-app-token.outputs.token }}
152160 TAG_NAME : ${{ github.event.workflow_run.head_branch }}
153161 VERSION : ${{ needs.check-version.outputs.VERSION }}
154162 run : |
155163 RELEASE_NAME="PMD For Eclipse ${VERSION}"
156- gh release create "$TAG_NAME" "net.sourceforge.pmd.eclipse.p2updatesite-${VERSION }.zip" \
164+ gh release create "$TAG_NAME" "net.sourceforge.pmd.eclipse.p2updatesite-${TAG_NAME }.zip" \
157165 --verify-tag \
158166 --notes-file release_notes_prepared.md \
159167 --title "$RELEASE_NAME"
You can’t perform that action at this time.
0 commit comments