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: use GITHUB_OUTPUT instead of deprecated set-output command #1061

Merged
merged 1 commit into from
Oct 17, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/rng/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ runs:
# -l: the number of bytes
# -c: the number of bytes displayed per column
value=$(xxd -p -l "$LENGTH" -c "$LENGTH" /dev/urandom)
echo "::set-output name=result::$value"
echo "result=$value" >> "$GITHUB_OUTPUT"
2 changes: 1 addition & 1 deletion internal/builders/container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
# NOTE: Set the image as an output because the `env` context is not
# available to the inputs of a reusable workflow call.
image_name="${IMAGE_REGISTRY}/${IMAGE_NAME}"
echo "::set-output name=image::$image_name"
echo "image=$image_name" >> "$GITHUB_OUTPUT"

# This step calls the container workflow to generate provenance and push it to
# the container registry.
Expand Down
30 changes: 15 additions & 15 deletions internal/builders/generic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
# sha256sum generates sha256 hash for all artifacts.
# base64 -w0 encodes to base64 and outputs on a single line.
# sha256sum artifact1 artifact2 ... | base64 -w0
echo "::set-output name=hashes::$(sha256sum artifact1 artifact2 | base64 -w0)"
echo "hashes=$(sha256sum artifact1 artifact2 | base64 -w0)" >> "$GITHUB_OUTPUT"

- name: Upload artifact1
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3.1.0
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
set -euo pipefail

checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
echo "::set-output name=hashes::$(cat $checksum_file | base64 -w0)"
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"
```

4. Call the generic workflow to generate provenance by declaring the job below:
Expand Down Expand Up @@ -358,7 +358,7 @@ jobs:
set -euo pipefail

checksum_file=$(echo "$ARTIFACTS" | jq -r '.[] | select (.type=="Checksum") | .path')
echo "::set-output name=hashes::$(cat $checksum_file | base64 -w0)"
echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT"

provenance:
needs: [goreleaser]
Expand Down Expand Up @@ -411,7 +411,7 @@ jobs:

sha256sum target_binary binary > checksums

echo "::set-output name=hashes::$(cat checksums | base64 -w0)"
echo "hashes=$(cat checksums | base64 -w0)" >> "$GITHUB_OUTPUT"
```

4. Call the generic workflow to generate provenance by declaring the job below:
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:

sha256sum target_binary binary > checksums

echo "::set-output name=hashes::$(cat checksums | base64 -w0)"
echo "hashes=$(cat checksums | base64 -w0)" >> "$GITHUB_OUTPUT"

provenance:
needs: [build]
Expand Down Expand Up @@ -502,7 +502,7 @@ jobs:

# Save the location of the maven output files for easier reference
ARTIFACT_PATTERN=./target/$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)-$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)*.jar
echo "::set-output name=artifact_pattern::$ARTIFACT_PATTERN"
echo "artifact_pattern=$ARTIFACT_PATTERN" >> "$GITHUB_OUTPUT"

```

Expand All @@ -512,7 +512,7 @@ jobs:
- name: Generate subject
id: hash
run: |
echo "::set-output name=hashes::$(sha256sum ${{ steps.build.outputs.artifact_pattern }} | base64 -w0)"
echo "hashes=$(sha256sum ${{ steps.build.outputs.artifact_pattern }} | base64 -w0)" >> "$GITHUB_OUTPUT"
```

4. Call the generic workflow to generate provenance by declaring the job below:
Expand Down Expand Up @@ -551,12 +551,12 @@ jobs:

# Save the location of the maven output files for easier reference
ARTIFACT_PATTERN=./target/$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)-$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)*.jar
echo "::set-output name=artifact_pattern::$ARTIFACT_PATTERN"
echo "artifact_pattern=$ARTIFACT_PATTERN" >> "$GITHUB_OUTPUT"

- name: Generate subject
id: hash
run: |
echo "::set-output name=hashes::$(sha256sum ${{ steps.build.outputs.artifact_pattern }} | base64 -w0)"
echo "hashes=$(sha256sum ${{ steps.build.outputs.artifact_pattern }} | base64 -w0)" >> "$GITHUB_OUTPUT"

- name: Upload build artifacts
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
Expand Down Expand Up @@ -606,7 +606,7 @@ jobs:
- name: Generate subject
id: hash
run: |
echo "::set-output name=hashes::$(sha256sum ./build/libs/* | base64 -w0)"
echo "hashes=$(sha256sum ./build/libs/* | base64 -w0)" >> "$GITHUB_OUTPUT"
```

4. Call the generic workflow to generate provenance by declaring the job below:
Expand Down Expand Up @@ -645,7 +645,7 @@ jobs:
- name: Generate subject
id: hash
run: |
echo "::set-output name=hashes::$(sha256sum ./build/libs/* | base64 -w0)"
echo "hashes=$(sha256sum ./build/libs/* | base64 -w0)" >> "$GITHUB_OUTPUT"

- name: Upload build artifacts
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
Expand Down Expand Up @@ -699,7 +699,7 @@ jobs:
run: |
set -euo pipefail

echo "::set-output name=hashes::$(sha256sum target_binary | base64 -w0)"
echo "hashes=$(sha256sum target_binary | base64 -w0)" >> "$GITHUB_OUTPUT"

```

Expand Down Expand Up @@ -743,7 +743,7 @@ jobs:
run: |
set -euo pipefail

echo "::set-output name=hashes::$(sha256sum target_binary | base64 -w0)"
echo "hashes=$(sha256sum target_binary | base64 -w0)" >> "$GITHUB_OUTPUT"

provenance:
needs: [build]
Expand Down Expand Up @@ -796,7 +796,7 @@ jobs:
run: |
set -euo pipefail

echo "::set-output name=hashes::$(sha256sum target_binary | base64 -w0)"
echo "hashes=$(sha256sum target_binary | base64 -w0)" >> "$GITHUB_OUTPUT"

```

Expand Down Expand Up @@ -846,7 +846,7 @@ jobs:
run: |
set -euo pipefail

echo "::set-output name=hashes::$(sha256sum target_binary | base64 -w0)"
echo "hashes=$(sha256sum target_binary | base64 -w0)" >> "$GITHUB_OUTPUT"

provenance:
needs: [build]
Expand Down