diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml deleted file mode 100644 index 58b2dda..0000000 --- a/.github/workflows/release-branch.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Test and Release - -on: - pull_request: - types: - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - test: - permissions: - pull-requests: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Hub Login - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_PAT }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build - uses: docker/build-push-action@v5 - with: - context: https://github.com/docker/scout-demo-service.git#fix-all-cves - push: false - load: true - tags: docker/scout-demo-service:fix - - name: TEST quickview no image - uses: ./ - with: - command: quickview - write-comment: false - - name: TEST quickview - uses: ./ - with: - command: quickview - image: docker/scout-demo-service:main - write-comment: false - - name: TEST cves - uses: ./ - with: - command: cves - image: docker/scout-demo-service:main - write-comment: false - - name: TEST compare images - uses: ./ - with: - command: compare - image: registry://docker/scout-demo-service:main - to: local://docker/scout-demo-service:fix - exit-code: false - write-comment: false - - release: - if: startsWith(github.head_ref, 'release/v') - permissions: - contents: write - outputs: - tag: ${{ steps.tagname.outputs.value }} - runs-on: ubuntu-latest - needs: test - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Tag name - uses: mad9000/actions-find-and-replace-string@2 - id: tagname - with: - source: ${{ github.head_ref }} - find: 'release/' - replace: '' - - name: Major version - uses: ashley-taylor/regex-property-action@v1.3 - id: major - with: - value: ${{ steps.tagname.outputs.value }} - regex: "\\.\\d+\\.\\d+$" - replacement: '' - - name: Merge and Tag - run: | - git config --unset-all http.https://github.com/.extraheader - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git config --global user.name "${GITHUB_ACTOR}" - git merge --ff-only origin/${{ github.head_ref }} - git tag ${{ steps.tagname.outputs.value }} - git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main --tags - git tag -f ${{ steps.major.outputs.value }} - git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main -f --tags - - create_release: - needs: - - release - uses: ./.github/workflows/release.yml - permissions: - contents: write - with: - tag: ${{ needs.release.outputs.tag }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e7b0faa..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: release - -on: - push: - tags: - - 'v*.*.*' - workflow_dispatch: - workflow_call: - inputs: - tag: - required: true - type: string - description: "The tag to release" - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - env: - RELEASE_REF: ${{ github.event_name == 'push' && github.ref_name || inputs.tag }} - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ env.RELEASE_REF }} - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - draft: true - tag_name: ${{ env.RELEASE_REF }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..490f050 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,59 @@ +name: Test + +on: + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + +jobs: + test: + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Hub Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PAT }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build + uses: docker/build-push-action@v5 + with: + context: https://github.com/docker/scout-demo-service.git#fix-all-cves + push: false + load: true + tags: docker/scout-demo-service:fix + - name: TEST quickview no image + uses: ./ + with: + command: quickview + write-comment: false + - name: TEST quickview + uses: ./ + with: + command: quickview + image: docker/scout-demo-service:main + write-comment: false + - name: TEST cves + uses: ./ + with: + command: cves + image: docker/scout-demo-service:main + write-comment: false + - name: TEST compare images + uses: ./ + with: + command: compare + image: registry://docker/scout-demo-service:main + to: local://docker/scout-demo-service:fix + exit-code: false + write-comment: false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9160bd8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +src/node_modules \ No newline at end of file