Skip to content

Commit

Permalink
give CI permission to update PR description
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Oct 12, 2023
1 parent 689259d commit 02d2959
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pr_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ permissions:
jobs:
pilot:
runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -74,14 +77,15 @@ jobs:
echo "eb done"
PR_UPDATE_FILE=$(mktemp ${{matrix.EASYSTACK_FILE}}.XXX)
echo "PR_UPDATE_FILE=${PR_UPDATE_FILE}" >> "${GITHUB_ENV}"
echo "# PR analysis for arch ${{matrix.EESSI_SOFTWARE_SUBDIR}}" > ${PR_UPDATE_FILE}
echo "grep start"
if [[ $(grep '.* out of .* required modules missing:' ${EB_MISSING_OUT}) ]]; then
# there may be multiple sections with the above search string
# we grab all lines listing missing modules and print a list of
# unique modules only
MISSING_MODULES=$(grep '^* ' ${EB_MISSING_OUT} | sort -u)
echo "found $(echo ${MISSING_MODULES} | wc -l) modules missing:"
echo "found $(echo ${MISSING_MODULES} | wc -l) modules missing:" > ${PR_UPDATE_FILE}
echo "found $(echo ${MISSING_MODULES} | wc -l) modules missing:" >> ${PR_UPDATE_FILE}
echo "${MISSING_MODULES}"
echo "<code>${MISSING_MODULES}</code>" >> ${PR_UPDATE_FILE}
else
Expand All @@ -93,6 +97,6 @@ jobs:
uses: nefrob/pr-description@eb00e54af678cf0d50a5b8fdd54b557c9cd8ddc5
with:
content: ${PR_UPDATE_FILE}
regex: "matchuntilthenend.*"
regex: "# PR analysis for arch ${{matrix.EESSI_SOFTWARE_SUBDIR}}.*"
regexFlags: i
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 02d2959

Please sign in to comment.