Skip to content

Commit

Permalink
Issue checkstyle#12995: Remove usages of append-to-github-output for …
Browse files Browse the repository at this point in the history
…non-multiline strings
  • Loading branch information
nrmancuso committed Apr 19, 2023
1 parent ba6a74d commit ed127db
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
12 changes: 10 additions & 2 deletions .ci/diff-report.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
set -e
set -x

source ./.ci/util.sh

Expand All @@ -11,10 +12,17 @@ download-files)
echo "Downloading files..."

# check for projects link from PR, if not found use default from contribution repo
LINK="${LINK_FROM_PR:-$DEFAULT_PROJECTS_LINK}"
#LINK=${LINK_FROM_PR:-$DEFAULT_PROJECTS_LINK}
# echo "LINK: $LINK"
# LINK=$(echo "$LINK" | tr -d '\r')

LINK=$DEFAULT_PROJECTS_LINK
if [ -n "$LINK_FROM_PR" ]; then
LINK=$LINK_FROM_PR
fi

# get projects file
curl --fail-with-body -X GET "${LINK}" \
curl --fail-with-body -X GET "$LINK" \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-o ../project.properties
Expand Down
41 changes: 23 additions & 18 deletions .github/workflows/diff-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,37 @@ jobs:
- name: Parsing content of PR description
id: parse
run: |
grep "^Diff Regression projects:" text | cat > temp
sed 's/Diff Regression projects: //' temp > projects_link
./.ci/append-to-github-output.sh "projects_link" "$(cat projects_link)"
PROJECTS_LINK=$(grep "^Diff Regression projects:" text | cat \
| sed 's/Diff Regression projects: //')
echo "projects_link=${PROJECTS_LINK}" >> $GITHUB_OUTPUT
grep "^Diff Regression config:" text | cat > temp
sed 's/Diff Regression config: //' temp > config_link
./.ci/append-to-github-output.sh "config_link" "$(cat config_link)"
CONFIG_LINK=$(grep "^Diff Regression config:" text | cat \
| sed 's/Diff Regression config: //')
echo "config_link=${CONFIG_LINK}" >> $GITHUB_OUTPUT
grep "^New module config:" text | cat > temp
sed 's/New module config: //' temp > new_module_config_link
./.ci/append-to-github-output.sh "new_module_config_link" "$(cat new_module_config_link)"
NEW_MODULE_CONFIG_LINK=$(grep "^New module config:" text | cat \
| sed 's/New module config: //')
echo "new_module_config_link=${NEW_MODULE_CONFIG_LINK}" >> $GITHUB_OUTPUT
grep "^Diff Regression patch config:" text | cat > temp
sed 's/Diff Regression patch config: //' temp > patch_config_link
./.ci/append-to-github-output.sh "patch_config_link" "$(cat patch_config_link)"
PATCH_CONFIG_LINK=$(grep "^Diff Regression patch config:" text | cat \
| sed 's/Diff Regression patch config: //')
echo "patch_config_link=${PATCH_CONFIG_LINK}" >> $GITHUB_OUTPUT
grep "^Report label:" text | cat > temp
sed 's/Report label: //' temp > report_label
./.ci/append-to-github-output.sh "report_label" "$(cat report_label)"
REPORT_LABEL=$(grep "^Report label:" text | cat \
| sed 's/Report label: //')
echo "report_label=${REPORT_LABEL}" >> $GITHUB_OUTPUT
echo "GITHUB_OUTPUT:"
# need to 'echo' to see output in Github CI
# shellcheck disable=SC2005
echo "$(cat "$GITHUB_OUTPUT")"
- name: Set branch
id: branch
run: |
./.ci/append-to-github-output.sh "ref" "$(cat branch)"
echo "ref=$(cat branch)" >> $GITHUB_OUTPUT
# shellcheck disable=SC2002
./.ci/append-to-github-output.sh "commit_sha" "$(cat commit_sha | cut -c 1-7)"
echo "commit_sha=$(cat commit_sha | cut -c 1-7)" >> $GITHUB_OUTPUT
echo "GITHUB_OUTPUT:"
# need to 'echo' to see output in Github CI
Expand All @@ -123,7 +128,7 @@ jobs:
- name: Download checkstyle
uses: actions/checkout@v3
with:
repository: ${{ env.USER_LOGIN }}/checkstyle
repository: checkstyle-ci-tester/checkstyle
ref: master
path: checkstyle
fetch-depth: 0
Expand Down

0 comments on commit ed127db

Please sign in to comment.