Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update deprecated commands #65

Merged
merged 1 commit into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04
container: pipelinecomponents/hadolint:0.10.1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run hadolint
run: hadolint Dockerfile

Expand All @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
needs: ["lint"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build Docker image
run: docker build -t $TEST_IMAGE_NAME .

Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-20.04
needs: build-test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Run integration test 1
uses: ./
Expand Down
5 changes: 4 additions & 1 deletion hadolint.sh
Expand Up @@ -44,7 +44,10 @@ if [ -n "$HADOLINT_OUTPUT" ]; then
fi

RESULTS="${RESULTS//$'\\n'/''}"
echo "::set-output name=results::$RESULTS"

echo "results<<EOF" >> $GITHUB_OUTPUT
echo "${RESULTS}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Comment on lines +48 to +50

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait does this actually work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just a simple way e.g.
echo "results=${RESULTS}" >> $GITHUB_OUTPUT ?
EOF syntax makes sense to use for multiline things, but there is one line echo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@mrdoodles mrdoodles Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViacheslavKudinov Because during my test the output actually was a multiline string so it failed with the simple format which was my original commit that failed and i force pushed over.

You can see the output from using the simple method here: https://github.com/hadolint/hadolint-action/actions/runs/3307229271/jobs/5671320194

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks @mrdoodles for clarification.

Copy link
Contributor Author

@mrdoodles mrdoodles Nov 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having said that I have just tried it again and it has passed:

My local test pull: https://github.com/mrdoodles/hadolint-local/pull/7
The workflow run: https://github.com/mrdoodles/hadolint-local/actions/runs/3443878466/jobs/5745890302

Could it be that sometimes there is multiline output in which case the longer format offers a better solution as it handles both scenarios?

Copy link

@maxhelias maxhelias Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The delimeter shouldn't be randomly generated? Like in this article : https://lab.amalitsky.com/posts/2022/github-actions-set-output-migration/


{ echo "HADOLINT_RESULTS<<EOF"; echo "$RESULTS"; echo "EOF"; } >> $GITHUB_ENV

Expand Down