Grype action #61
Workflow file for this run
This file contains hidden or 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: Test pkg-remove action | |
| "on": | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| jobs: | |
| keep-none: | |
| name: with keep=0 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Test | |
| id: test | |
| uses: ./pkg-remove | |
| with: | |
| anaconda_token: unset_token | |
| organization: neutronimaging | |
| package_name: ibeatles | |
| label: dev | |
| keep: 0 | |
| dry_run: true | |
| - name: Check number files | |
| shell: bash | |
| env: | |
| NUM_REMOVED: ${{ steps.test.outputs.num_removed }} | |
| run: | | |
| echo "Number of files is ${NUM_REMOVED}" | |
| if [ -z "${NUM_REMOVED}" ]; then | |
| echo "Did not get variable" | |
| exit 1 | |
| elif [ ! "${NUM_REMOVED}" -gt 0 ]; then | |
| echo "Something went wrong!" | |
| exit 1 | |
| fi | |
| keep-all: | |
| name: with keep=100 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Test | |
| id: test | |
| uses: ./pkg-remove | |
| with: | |
| anaconda_token: unset_token | |
| organization: neutronimaging | |
| package_name: ibeatles | |
| label: dev | |
| keep: 100 | |
| dry_run: true | |
| - name: Check number files | |
| shell: bash | |
| env: | |
| NUM_REMOVED: ${{ steps.test.outputs.num_removed }} | |
| run: | | |
| echo "Number of files is ${NUM_REMOVED}" | |
| if [ -z "${NUM_REMOVED}" ]; then | |
| echo "Did not get variable" | |
| exit 1 | |
| elif [ ! "${NUM_REMOVED}" -eq 0 ]; then | |
| echo "Something went wrong!" | |
| exit 1 | |
| fi |