Skip to content

Update step-security/harden-runner action to v2.15.0 #843

Update step-security/harden-runner action to v2.15.0

Update step-security/harden-runner action to v2.15.0 #843

Workflow file for this run

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@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
- name: Setup yq (pypi.org/project/yq/)
run: |
pip3 install yq==${YQ_VERSION}
- name: Setup Bats
uses: bats-core/bats-action@42fcc8700f773c075a16a90eb11674c0318ad507 # 3.0.1
- name: Setup Conftest
uses: princespaghetti/setup-conftest@427bf563268433011fd432d23ae41e567cc24272 # v1.1.26
- 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@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
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.1.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@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: bats-library.tar
- name: Upload assets to release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
files: |
bats-library.tar