Update actions/upload-artifact digest to 65c4c4a #517
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate and Release | |
on: [push, pull_request] | |
# Declare default permissions as read only. | |
permissions: read-all | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
env: | |
# renovate: datasource=pypi depName=yq | |
YQ_VERSION: 3.4.3 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
- name: Setup yq (pypi.org/project/yq/) | |
run: | | |
pip3 install yq==${YQ_VERSION} | |
- name: Setup Bats | |
uses: bats-core/bats-action@2104b40bb7b6c2d5110b23a26b0bf265ab8027db # 3.0.0 | |
- name: Setup Conftest | |
uses: princespaghetti/setup-conftest@8988df9968f72ab406646e033cfe1765eb201e94 # v1.1.22 | |
- name: Setup oc | |
uses: redhat-actions/openshift-tools-installer@144527c7d98999f2652264c048c7a9bd103f8a82 # v1 | |
with: | |
oc: "4" | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0 | |
env: | |
SHELLCHECK_OPTS: -x | |
with: | |
ignore_paths: test | |
- name: Conftest - tests.sh | |
run: | | |
test/tests.sh | |
- name: Conftest - tests_fail.sh | |
run: | | |
test/tests_fail.sh > tests_fail.log || exit 0 | |
cat tests_fail.log | |
if [[ $(grep -c "not ok" tests_fail.log) -ne 9 ]]; then | |
echo "Expected a fixed number of failed jobs. Failing." | |
exit 1 | |
fi | |
- name: Tar and Generate hashes | |
shell: bash | |
id: hash | |
run: | | |
tar cvf bats-library.tar load.bash src/ | |
echo "hashes=$(sha256sum bats-library.tar | base64 -w0)" >> "$GITHUB_OUTPUT" | |
- name: Upload bats-library.tar | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4 | |
with: | |
name: bats-library.tar | |
path: bats-library.tar | |
if-no-files-found: error | |
retention-days: 5 | |
outputs: | |
hashes: ${{ steps.hash.outputs.hashes }} | |
provenance: | |
needs: [validate] | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0 # v2.0.0 | |
with: | |
base64-subjects: "${{ needs.validate.outputs.hashes }}" | |
upload-assets: true | |
release: | |
needs: [validate, provenance] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
contents: write | |
steps: | |
- name: Download bats-library.tar | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
name: bats-library.tar | |
- name: Upload assets to release | |
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0 | |
with: | |
files: | | |
bats-library.tar |